"Exclude from Nav" does its job in Header, but doesn't let me include "exluded pages" into other autonavs.

Permalink
Hi there,

I am pretty sure that this topic must have been arised by other members, hwever I have not been able to find the solution. If so please send me the link.

My problem is the following one:
When I "exclude from nav" certain pages using custom attributes, it makes its job in the header nav. However, these "excluded from nav" pages will not be displayed in other autonavs that I would like to create, such as left sidebar navs.

The pages that I am excluding are a range of pages and subpages.

How could I achieve this?

Thanks in advance for any advice or suggestion!

ggutierrez79
 
mckoenig replied on at Permalink Reply
mckoenig
I for one created myself an autonav template with a custom view checking for a newly created page attribute.
Let's say I wanted to build a subnav only including five pages. Then I add a page attribute called "subnav" and add it to those pages and check for this attribute in the custom view. The pages that have it get displayed the ones that don't have it don't get displayed.

You can check for attributed in the autonav view like this:

foreach($aBlocks as $ni) {
$_c = $ni->getCollectionObject();if($_c->getCollectionAttributeValue('your_attribute_name')){
   your code
}}


Mind this may not be the
ggutierrez79 replied on at Permalink Reply
ggutierrez79
Many thanks for that!

That could make the job. However I am looking at using Superfish Dropdown Menu for the left sidebar navigation and Superfish reads the main "Exclude from Nav", therefore it will not display my pages and subpages.

Any idea??
mckoenig replied on at Permalink Reply
mckoenig
Just remove the if statement checking for the "remove_from_nav" attribute from your custom view template ;)
ggutierrez79 replied on at Permalink Reply
ggutierrez79
Hi mate,

I am afraid I do not uderstand well your explanation. Could you please list the actions, step by step.

What line in the template would you exactly paste the code?

Sorry I am a bit lost.

Thanks for your help!
mckoenig replied on at Permalink Best Answer Reply
mckoenig
Sorry, I'm not familiar with the Superfish Dropdown menu. Can't help you with details there. But you would have to look into the view.php (create your own by duplicating it) and see where it checks for the exclude_from_nav attribute. If you modify it at this position you can remove the check or exchange it for something else.
mckoenig replied on at Permalink Reply
mckoenig
Maybe your problem can be solved through the free Manual Nav block available in the marketplace.