Is it possible to remove the exclude from nav attribute on a custom autonav?
Permalink
I am using two different auto-navs on a site. There are pages that have the attribute 'exclude from nav' as I want these hidden from the main navigation. However, I have a second custom autonav that I've created. I want this nav to ignore the 'exclude from nav' attribute and show all the pages.
Is there something I can add to my custom nav to tell it to disregard 'exclude from nav'?
Thanks!
Is there something I can add to my custom nav to tell it to disregard 'exclude from nav'?
Thanks!
![Remo](/files/avatars/26.jpg)
Are you familar with custom block templates?
Somewhat. I've created a custom block for this autonav. It's a way for a user to drop a tertiary nav within the content of the page. What I don't understand is how to disregard 'exclude from nav' programatically. I know this is possible, I'm just not sure of the code needed. Do you have any tips?
OK - I found a solution to this. In my custom auto-nav implementation, I changed the $exclude_page = true; in the following code to "false":
This probably isn't the most elegant solution - but it seems to work for my purposes.
if ($_c->getAttribute('exclude_nav') && ($current_level <= $excluded_parent_level)) { $excluded_parent_level = $current_level; $exclude_page = true; } else if (($current_level > $excluded_parent_level) || ($current_level > $exclude_children_below_level)) { $exclude_page = true;
This probably isn't the most elegant solution - but it seems to work for my purposes.
Modifying the block template is the way to go. You could have removed a few more lines instead of changes that variable but that's fine too..