Two autonavs with different pages of the same level
Permalink 1 user found helpful
Hello everybody. Here's my website's structure:
My intention is to have two autonav blocks on each page, configured like so:
Autonav1: Home, Introduction, Blog, About
Autonav2: Service 1, Service 2, etc.
The "Service" pages intentionally don't exist in their own parent folder, because I want to keep their URL very simple:http://www.mysite.com/service1, http://www.mysite.com/service2 and so on.
Any ideas? Perhaps there's a way to only include particular page types in the autonavs, so I could set the first nav to display select page types, and the second one to display the remaining ones?
Related discussions:
http://www.concrete5.org/community/forums/customizing_c5/split-auto...
http://www.concrete5.org/community/forums/customizing_c5/using-page...
+ Home - Introduction - Blog * Blog post 1 * Blog post 2 - About - Service 1 - Service 2
My intention is to have two autonav blocks on each page, configured like so:
Autonav1: Home, Introduction, Blog, About
Autonav2: Service 1, Service 2, etc.
The "Service" pages intentionally don't exist in their own parent folder, because I want to keep their URL very simple:http://www.mysite.com/service1, http://www.mysite.com/service2 and so on.
Any ideas? Perhaps there's a way to only include particular page types in the autonavs, so I could set the first nav to display select page types, and the second one to display the remaining ones?
Related discussions:
http://www.concrete5.org/community/forums/customizing_c5/split-auto...
http://www.concrete5.org/community/forums/customizing_c5/using-page...
The "Page List" block will do what you want. Just create two different pagetypes and tell the pagelists in your headnav which types they should display. done.
Sounds like a plan. The Page List block outputs several divs, is there a way I could make it output UL and LIs like Autonav does?
You could hack the view.php of the PageList and create a custom template. Just replace the div tags with whatever ul/li tags you need - if that is really necessary.
If you are on 5.7, create a "page_list" directory in /application/blocks
and subdirectories /templates/head_nav
now copy the view.php and view.css of the pagelist block (find it in /concrete/blocks/page_list )
into /application/blocks/page_list/templates/head_nav
and change it as you like. In the lower portion of the code, you will find the output that renders the whole thing, there you can replace the divs with ul/li
now when adding the pagelists to your header, choose the custom template and you should be good.
If you are on 5.7, create a "page_list" directory in /application/blocks
and subdirectories /templates/head_nav
now copy the view.php and view.css of the pagelist block (find it in /concrete/blocks/page_list )
into /application/blocks/page_list/templates/head_nav
and change it as you like. In the lower portion of the code, you will find the output that renders the whole thing, there you can replace the divs with ul/li
now when adding the pagelists to your header, choose the custom template and you should be good.
A variation of the same solution. Have a look at the implementation of the exclude from nav attribute in the default view.
You could add exclude from nav attributes to your services pages, so the main autonav works as usual, just doesn't show the services pages.
Then in a new 'services' view template for autonav (or for a page list), have a 'services only' attribute and change the filtering to only include pages with that attribute.
You could add exclude from nav attributes to your services pages, so the main autonav works as usual, just doesn't show the services pages.
Then in a new 'services' view template for autonav (or for a page list), have a 'services only' attribute and change the filtering to only include pages with that attribute.
Thanks for your answer, that would definitely work fine too.
Thank you, I managed to set it up and style it properly with the help of this post. It works exactly like I wanted now.