AutoNav not respecting 'Exclude From Nav'
Permalink
Subject says it all really. I have set up a few pages with the 'exclude from nav' attribute and they're still showing up in my AutoNav. I have a custom template for the nav but I have also tried using the default. In both instances the unwanted pages even show up in the block edit screen preview. I've also tried setting the 'exclude from page list' option. I've even set up a new page type with the option turned on and still no luck.
No errors in Web Dev console
Installed Add-Ons: Block Designer
Running the latest version of C5 at time of writing (5.7.5.3)
Page caching off
No errors in Web Dev console
Installed Add-Ons: Block Designer
Running the latest version of C5 at time of writing (5.7.5.3)
Page caching off
have you tried refreshing the page in question after the change of that attribute?
Many, many times.
I've hacked around this by checking for the attribute manually. The page in question had it's attribute stored as a string zero ('0'), whilst other pages had their values as boolean false - so I set the following code.
Surely there's a better way?
foreach ($navItems as $ni) { $exclude_nav = $ni->cObj->getAttribute('exclude_nav'); if( $exclude_nav !== '0' ): // echo list items, etc endif; }
Surely there's a better way?
This is not working for me and I'm trying to figure out where in the database the page and attributes are stored and related...