Access Keys?
Permalink
Maybe a silly question. But how do I add accesskey="" to the main nav.I can do it on the page, but don't need to.Tried fiddling around but cant seem to get access to the main nav.
Any Ideas?
Cheers
Steev
Any Ideas?
Cheers
Steev
whats an access key?
Access Keys are for the accessibility of a website through the keyboard. It has long been a requirement for web design. I use them all the time. Now that I am getting quite good with Concrete5 I need to tie up loose ends and this is one of many.
government (UK) standard for access Keys
S - Skip navigation
1 - Home page
2 - Newsroom
3 - Site map
6 - Help
7 - Complaints
8 - Terms and conditions
9 - Feedback form
0 - Access key details
Usage:- <a href="#" title="home" class="nav-selected" accesskey="1">Home</a>
Control:- alt+1 (Windows) ctrl+1 (Mac)
government (UK) standard for access Keys
S - Skip navigation
1 - Home page
2 - Newsroom
3 - Site map
6 - Help
7 - Complaints
8 - Terms and conditions
9 - Feedback form
0 - Access key details
Usage:- <a href="#" title="home" class="nav-selected" accesskey="1">Home</a>
Control:- alt+1 (Windows) ctrl+1 (Mac)
custom templates?
It seems a little strange that after more than twelve months, the two posts about access keys has not been resolved?
Until now!
Eureka I did it!
I made it work!
This is what I've done.
In Dashboard - Pages and Themes - Page Attributes add two Text attributes called 'Title' and 'AccessKey' - see screen shots.
You will need access to your server directory, in the root find the blocks folder, then create another folder called autonav.
Create new file in the autonav folder called view.php and paste my code.
No need for custom templates or any fancy footwork.
I'm not a developer in the true sense, but I do try to fiddle with code.
Thanks to Lucas for suggesting Attributes and Sean for his code that I played with.
I persevered for two days and I think I cracked it!
If anybody else tries it and it works for them as well perhaps it could go in the core?
Let me know what you think
Until now!
Eureka I did it!
I made it work!
This is what I've done.
In Dashboard - Pages and Themes - Page Attributes add two Text attributes called 'Title' and 'AccessKey' - see screen shots.
You will need access to your server directory, in the root find the blocks folder, then create another folder called autonav.
Create new file in the autonav folder called view.php and paste my code.
No need for custom templates or any fancy footwork.
I'm not a developer in the true sense, but I do try to fiddle with code.
Thanks to Lucas for suggesting Attributes and Sean for his code that I played with.
I persevered for two days and I think I cracked it!
If anybody else tries it and it works for them as well perhaps it could go in the core?
Let me know what you think
<?php defined('C5_EXECUTE') or die("Access Denied."); $aBlocks = $controller->generateNav(); $c = Page::getCurrentPage(); $containsPages = false; $nh = Loader::helper('navigation'); //this will create an array of parent cIDs $inspectC=$c; $selectedPathCIDs=array( $inspectC->getCollectionID() ); $parentCIDnotZero=true; while($parentCIDnotZero){ $cParentID=$inspectC->cParentID; if(!intval($cParentID)){ $parentCIDnotZero=false; }else{
Viewing 15 lines of 75 lines. View entire code block.
Next step applying title and access keys to existing pages.
Either from the Dashboard - Sitemap choose your page or any page in edit mode.
Choose Properties - Custom Attributes - Add Attribute - choose Title and AccessKey.
Fill in the attributes and save - see screen shots.
Now when you add the autonav you should see Title and AccessKey.
Same applies when adding new pages.
So now it is time to go around all websites and apply this to the autonav
Hope this works for you.
Either from the Dashboard - Sitemap choose your page or any page in edit mode.
Choose Properties - Custom Attributes - Add Attribute - choose Title and AccessKey.
Fill in the attributes and save - see screen shots.
Now when you add the autonav you should see Title and AccessKey.
Same applies when adding new pages.
So now it is time to go around all websites and apply this to the autonav
Hope this works for you.
I'm sorry,
Is this not important?
Is this not important?