access key navigation
Permalink 1 user found helpfulThanks in advance
Karl

What does that mean?
I was thinking of having a go at creating a block but I think Lucas is right a custom attribute could be a better way to go about this,
I would be tempted to add in two attributes though,
One for the Access Key and one for the Title.
Let me have a play and see what I can come up with.
(I know this is quite an old thread but I would like to see something like this to help save time each time I do a site.)
I have removed the title attribute as I want to use the Page name and always use "go to {page_name} page"
I also use a display of hidden in my main style sheet to stop it being displayed on screen and print. Not tested on screen readers but they should pick it up?
I have just edited one of the autonav templates but it does what I need it to do now hope it helps someone else out.
<?php defined('C5_EXECUTE') or die("Access Denied."); $aBlocks = $controller->generateNav(); $c = Page::getCurrentPage(); $i = 0; echo ("<!-- access keys - UK government accesskeys system --> "); echo("\r\n<div id=\"access-keys\">"); //$nh = Loader::helper('navigation'); //$isFirst = true; foreach($aBlocks as $ni) { $_c = $ni->getCollectionObject(); if (!$_c->getCollectionAttributeValue('exclude_nav') && $_c->getCollectionAttributeValue('access_key')) { $target = $ni->getTarget(); if ($target != '') { $target = 'target="' . $target . '"';
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 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{
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.
Is this not important?
I've never missed not having this feature. I can see where it could be helpful however so I followed and "earmarked" the thread for future use.
THX