Adding subtitles to autonav template
Permalink
Hello everyone.
I'm attempting to output the following code with the autonav template:
I've created a "subtitle" attribute for pages.
I want to change the autonav so that it automatically outputs the subtitle attribute wrapped in <div></div> tags. I've looked through the autonav template but don't know where to adjust things.
I think I need to use the following somewhere:
Any help is greatly appreciated!
Thanks,
Dan
I'm attempting to output the following code with the autonav template:
<nav> <ul> <li><a href="#">Link Title<div>link subtitle</div></a></li> <li><a href="#">Link Title<div>link subtitle</div></a></li> <li><a href="#">Link Title<div>link subtitle</div></a></li> </ul> </nav>
I've created a "subtitle" attribute for pages.
I want to change the autonav so that it automatically outputs the subtitle attribute wrapped in <div></div> tags. I've looked through the autonav template but don't know where to adjust things.
I think I need to use the following somewhere:
<?php echo $c->getAttribute('subtitle') ?>
Any help is greatly appreciated!
Thanks,
Dan
Okay. I somehow got it working. Here's the code I used if anyone else is looking to do something similar:
<?php //NOTE: For extra functionality, you can add the following page attributes (via Dashboard -> Pages and Themes -> Attributes): // // 1) Handle: replace_link_with_first_in_nav // Type: Checkbox // Functionality: If a page has this checked, clicking on it in the nav menu will go to its first child (sub-page) instead. // // 2) Handle: exclude_subpages_from_nav // Type: Checkbox // Functionality: If a page has this checked, all of that pages children (sub-pages) will be excluded from the nav menu (but the page itself will be included). // // 3) Handle: disable_link_in_nav // Type: Checkbox // Functionality: If a page has this checked, it will appear in the nav menu but will not be "clickable" (will not link to any page). //
Viewing 15 lines of 210 lines. View entire code block.
On line 78 I added:
On line 138 I added:
And on line 236 I changed the output to this:
Does anyone know what I need to change to make it display the page's attribute rather than another page's attribute?
Thanks,
Dan