Exclude pages from secondary navigation menu
Permalink
I have an autonav sidebar menu working perfectly with pages excluded by 'Exclude from nav'.
I have a secondary footer autonav menu with a different template, based on autonav view.php.
I wish to exclude some pages from the secondary footer menu.
Searching yields references to copying the 'Exclude from nav' code from view.php and changing it for one's own attribute handle. However, view.php no longer contains 'Exclude from nav' code.
What code should I place where in my autonav template to be able to exclude pages from my secondary navigation?
Thank you.
I have a secondary footer autonav menu with a different template, based on autonav view.php.
I wish to exclude some pages from the secondary footer menu.
Searching yields references to copying the 'Exclude from nav' code from view.php and changing it for one's own attribute handle. However, view.php no longer contains 'Exclude from nav' code.
What code should I place where in my autonav template to be able to exclude pages from my secondary navigation?
Thank you.
" I'll give more detailed instructions"
Hi Julian
That is exactly what I would like if that is possible. As I said all the references so far talk about copying and changing the include in nav lines of code, but that is no longer present.
An explanation of where to add code to the auto nav layout to exclude or include by custom attributes would be a great help and I guess not just to me.
Thank you.
Jonathan
Hi Julian
That is exactly what I would like if that is possible. As I said all the references so far talk about copying and changing the include in nav lines of code, but that is no longer present.
An explanation of where to add code to the auto nav layout to exclude or include by custom attributes would be a great help and I guess not just to me.
Thank you.
Jonathan
I would be very grateful if you could describe the coding necessary to use a custom autonav template to filter out any pages with a custom attribute (eg: exclude_from_Footer_nav)
I think there a great many people who would value this advice if you were kind enough to give it.
Thank you
I think there a great many people who would value this advice if you were kind enough to give it.
Thank you
Sorry, I've not been on the forum for a few days.
There's a simple way to do what you want using the 'is_featured' page attribute. Add an AutoNav block to your footer, then within the block settings there is already a filter set up to show featured pages, which you could use to show the pages you want to appear within the footer nav. To use it, you have to add a Checkbox page attribute with the handle is_featured and then edit the properties of all the pages you want in the footer and tick that new attribute. Check out this thread for how to do it:
http://www.concrete5.org/community/forums/usage/how-to-add-the-andq...
If you really want to change the AutoNav block, try searching the forum for 'Override Core' and see what comes up. This looks like a decent thread on the topic:
http://www.concrete5.org/community/forums/customizing_c5/override-c...
I hope that helps.
There's a simple way to do what you want using the 'is_featured' page attribute. Add an AutoNav block to your footer, then within the block settings there is already a filter set up to show featured pages, which you could use to show the pages you want to appear within the footer nav. To use it, you have to add a Checkbox page attribute with the handle is_featured and then edit the properties of all the pages you want in the footer and tick that new attribute. Check out this thread for how to do it:
http://www.concrete5.org/community/forums/usage/how-to-add-the-andq...
If you really want to change the AutoNav block, try searching the forum for 'Override Core' and see what comes up. This looks like a decent thread on the topic:
http://www.concrete5.org/community/forums/customizing_c5/override-c...
I hope that helps.
I believe the Page List is the block that uses the 'is_featured' attribute, not the AutoNav.
All the hits on e forum say look for:
And change exclude_nav for the attribute you want. This code is no longer in autonav view.php
Please can anyone show me how to add this code to a copy of the current autonav view.php to make a new template? I really cannot believe that such a basic piece of functionality can be so hard.
Thank you
$isFirst = true; foreach($aBlocks as $ni) { $_c = $ni->getCollectionObject(); if (!$_c->getCollectionAttributeValue('exclude_nav')) {
And change exclude_nav for the attribute you want. This code is no longer in autonav view.php
Please can anyone show me how to add this code to a copy of the current autonav view.php to make a new template? I really cannot believe that such a basic piece of functionality can be so hard.
Thank you
The basic problem is that the AutoNav was the second piece of code ever written for concrete5 and so it's a little convoluted.
Overriding it requires that we figure out where to put the override copy of '[root]/concrete/core/controllers/blocks/autonav.php' file which contains the snippet you are looking for. I'm working on it without much success so if anyone with more experience in overriding the AutoNav controller with a custom template would like to chime in here, that would be great.
Overriding it requires that we figure out where to put the override copy of '[root]/concrete/core/controllers/blocks/autonav.php' file which contains the snippet you are looking for. I'm working on it without much success so if anyone with more experience in overriding the AutoNav controller with a custom template would like to chime in here, that would be great.
Ok, download the attached file and rename it to 'view.php'
Put it in: '[root]/blocks/autonav/templates/exclude_from_footer/view.php'
Add a page attribute called 'exclude_from_footer' and apply it to all the pages you DON'T want to show on the footer menu.
I modified the autonav template included in the free Boldy theme by Mnkras:
http://www.concrete5.org/marketplace/themes/boldy/...
Put it in: '[root]/blocks/autonav/templates/exclude_from_footer/view.php'
Add a page attribute called 'exclude_from_footer' and apply it to all the pages you DON'T want to show on the footer menu.
I modified the autonav template included in the free Boldy theme by Mnkras:
http://www.concrete5.org/marketplace/themes/boldy/...
A gentleman and a genius! Thank you so much for your time and trouble.
I really hope many others find this as useful as I.
My test site is at:http://graphicz.eu.com/concrete5/... and you will see on the left is an autonav with a template styled for SuperFish and at the bottom an autonav using the css menu from line25.com displaying only those pages that do not have exclude_from_footer ticked (checked). Both are hierarchical.
Very grateful thanks once again.
I really hope many others find this as useful as I.
My test site is at:http://graphicz.eu.com/concrete5/... and you will see on the left is an autonav with a template styled for SuperFish and at the bottom an autonav using the css menu from line25.com displaying only those pages that do not have exclude_from_footer ticked (checked). Both are hierarchical.
Very grateful thanks once again.
"Genius is divine perseverance. Genius I cannot claim nor even extra brightness but perseverance all can have."
~ Woodrow Wilson
~ Woodrow Wilson
Perhaps thinking about it the other way around. I have used a Page List sometimes as a nav because you can select pages that have a certain attribute. So as juliandale suggests, you can create a new page attribute but call it 'include_in_footer' and then set the Page List up to grab only those pages that have that attribute.
Or you could try this free add-on and build a nav manually in a stack and then add the stack to the footer area.
http://www.concrete5.org/marketplace/addons/manual-nav/...
Or you could try this free add-on and build a nav manually in a stack and then add the stack to the footer area.
http://www.concrete5.org/marketplace/addons/manual-nav/...
"I have used a Page List sometimes as a nav"
Thanks for that - I would like my lists to be unordered lists with hierarchy (several levels). I think page lists give one level list of selected pages.
Thanks for that - I would like my lists to be unordered lists with hierarchy (several levels). I think page lists give one level list of selected pages.
Yes, you are correct, Page Lists can pull pages from anywhere based on a page attribute but display is a single flat list.
Easy fix for this here: by Jordan Lev
http://concrete5tricks.com/blog/ignore-exclude-from-nav-attribute-i...
http://concrete5tricks.com/blog/ignore-exclude-from-nav-attribute-i...
Let me know if you need help to get it to work and I'll give more detailed instructions.