Autonav improvement

Permalink
I am using Autonav for both the navigation and breadcrumb. However I have a blog on the website, which I don't want to be displayed in the drop-down of the navigation. But when I use the custom-attribute exclude-all-sub-pages, it hides them on the breadcrumb as well!.

Having a tick box on the add/edit of an autonav along the lines of "Ignore exclude from nav/sub-pages" would be extremely handy, fir breadcrumbs and certain other things. Don't you think?

CommotionCreative
 
JohntheFish replied on at Permalink Reply
JohntheFish
You can probably get round this limitation with a custom template for the autonav. Since c5.6 it has been much improved and is far easier to template than it used to be.
CommotionCreative replied on at Permalink Reply
CommotionCreative
How would I do this? there is not reference in the templates, it seems to be passing back the results already: $navItems = $controller->getNavItems(); so you only get the links that it will display to output
JohntheFish replied on at Permalink Reply
JohntheFish
My thought was to pass all the nav info to the view template and add your own filter there before outputting.

A more efficient solution, though probably more complex code to dig into, would be to override the block controller and insert a test for the breadcrumbs template being used and skip the exclude-all test if the breadcrumbs template was selected. A simple test, but complicated code to dig through in order to work out where to place it.

Maybe you could also post your initial suggestion as a bug report. Its a good idea. That way it would get put on an official list and may find its way as an improvement into the next version.
jordanlev replied on at Permalink Best Answer Reply
jordanlev
I ran into this same issue, it's probably my fault to begin with (I overhauled the autonav code to make it a lot cleaner, but didn't think about how breadcrumbs should ignore the "hide pages" attributes).

I have a request in to fix this in the system:
https://github.com/concrete5/concrete5/pull/696/files...

If you aren't a coder and/or don't understand what that all means, let me know and I can write out step-by-step instructions on how to put that into your own site.

If you happen to have a github account, it wouldn't hurt if you added a comment to that pull request saying you think it's a good idea :)

-Jordan
CommotionCreative replied on at Permalink Reply
CommotionCreative
Hello thanks for the code, I came across a bit of code which I implemented myself that gave me the same effect I wanted, hopefully this will be implemented

:)

Commotion