Yes! This is an amazing module and gave me exactly what the client asked for: a 3 level navigation, nested lists with links that the client can manage.
In case anyone needs help with nesting navigation groups, read on.
I followed dreamscape’s advice which was deviously clever; subcategories are fairly simple this way. The trick is to set up several navigation groups - 1 for the top level, 1 for each 2nd level group, 1 for each 3rd level group - and to set “nav_properties” in the parent link so that you target the child links. If your “About” link needs to open up a subcategory that you’ve placed in group 2, set nav_properties in “About” to “2.” Easy peasy.
Here’s my nav, located in the main page template:
<ul>
{exp:navigator group="1"}
<li>
<a href="http://{nav_url}{nav_url_title">{nav_title}</a>
{if nav_properties <> "0"}{embed="inc/nav-2" group="{nav_properties}"}{/if}
</li>
{/exp:navigator}
</ul>
I set nav_properties to “0” if there is no child category. If nav_properties isn’t “0” then template nav-2 is embedded:
<ul>
{exp:navigator group="{embed:group}"}<li>
<a href="http://{nav_url}{nav_url_title}">{nav_title}</a>
{if nav_properties <> "0"}{embed="inc/nav-3" group="{nav_properties}"}{/if}
</li>{/exp:navigator}
</ul>
same thing for the third level, template nav-3:
<ul>
{exp:navigator group="{embed:group}"}<li><a href="http://{nav_url}{nav_url_title}">{nav_title}</a></li>{/exp:navigator}
</ul>
Cocoaholic, I can’t thank you enough for this. 😊
Module updated to 1.3
New in this version: - MSM compatibility
Note: - If you are already using the module with MSM and you have some navigator groups setup be aware that after updating the module all existing navigator groups will be assigned to site 1. Contact me if you have a large amount of navigator groups and really need some way to re-assign those groups to different sites.
If you have any questions feel free to contact me!
I have a multi-level drop down menu as per Colin Lewis and I’m looking to move to Navigator but am trying to figure out how to highlight the menu item of the that you are currently on.
With the old hardcoded navigation I had this;
<li class="{if segment_1=='about-us'}current{/if}"><a href="http://{site_url}about-us"><b>About Us</b></a></li>
I’ve played around and can’t quite get it going, if any one has any suggestions?
Thanks mdesign - to clarify, my hardcoded example does work, but when trying to incorporate Navigator I’m not sure of the best what to go about it with Navigator’s loops etc. e.g.
<li{if segment_1=="{nav_description}"} class="current"{/if}><a href="http://{nav_url}{nav_url_title}"><b>{nav_title}</b></a></li>
I’ve put about-us in the nav_description field but’s not working - it’s fine if I replace {nav_description} with about-us…
I’m trying to get the second level to appear only when I’m in a certain section…
I want my second segment to match up to my nav_property which would hopefully kick in and embed on just that one page like this:
<ul>
{exp:navigator group="solutions"}
<li>
<a href="http://{nav_url}">{nav_title}</a>
{if "{segment_2}" == "{nav_properties}"} {embed="solutions/nav-2" group="{nav_properties}"} {/if}
</li>
{/exp:navigator}
</ul>
I even tried passing a variable like this in my embeds:
{if "{embed:my_location}" == "data-federation"}{embed="solutions/nav-2"} {/if}
But I can’t seem to target that specific page.
Any thoughts? Much appreciated!
Here is how I am doing it:
In my main template I embed the menu like this:
{embed="menus/side_menu" side_menu_title="Main Menu" side_menu_group="1"}
Then in the side_menu file I have this:
<div class="module_container">
<div class="module_header">
<h1>{embed:side_menu_title}</h1>
</div>
<div class="module_content">
<div id="nav_container">
<ul>
{exp:navigator group="{embed:side_menu_group}"}
<li>
<a href="http://{nav_url}">{nav_title}</a>
{if nav_properties != ""}
{embed="menus/side_menu_l2" group="{nav_properties}" parent="{nav_description}"}
{/if}
</li>
{/exp:navigator}
</ul>
</div>
</div>
</div>
Then in the side_menu_l2 I have:
{if segment_2=="{embed:parent}"}
<ul>
{exp:navigator group="{embed:group}"}
<li>
<a href="http://{nav_url}">{nav_title}</a>
</li>
{/exp:navigator}
</ul>
{/if}
This is using the pages module for static pages which is most of the content on the site. I am pretty busy so I may not be able to get back to you right away.
Essentially, the way this is working is the main template embeds the menu and tells it which navigator group to pull at the 1st level.
Then on any of the menus if there is a property set in the navigator module, it will then embed the second level using the property field as the group to embed.
When the second level gets embedded, the nav description of the parent menu gets passed through the embed.
Then the second level embed checks to see of segment_2 of the current url matches the nav_description of the parent menu. If it does match then the 2nd level embed then outputs the sub-menus.
Hope this will help you in the right direction. You may have to adjust things a bit to get it working in your specific situation, hopefully someone here will be able to help you.
Let me know what solution you come up with.
Best of luck.
Steve
While setting up conditionals to add classes to my navigation items, I ran into the same problem as mr_tim’s post #100 above.
But then I discovered I can just swap the order of the conditional.
Instead of
{if segment_1=="{nav_description}"}
I used
{if nav_description=="{segment_1}"}
I’m not sure why this works… time to dig into the docs
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.