I have been developing a new site over the last week and thought I would share my solution to a little MODx navigation issue that has cropped up on occasion. I often fined myself frustrated when trying to explain/discern navigational issues in the forums. So, rather than diving into a lengthy explanation of 1st tier, 2nd tier and 3rd tier navigation I thought the screenshot below would help condense my explanation.
In the past I have run into issues when building navigation like this because the secondary navigation completely changes depending on which area of the 1st tier you are in as you view the site.
Best that I can gather (Please let me know if I am wrong here), Wayfinder will not output only the active Parent directory name and link (red circle) with a single call. The rest of the menu can be generated, but not this line.
My solution was to use the Wayfinder, UltimateParent and GetField snippets to create a single, unordered list:
<ul> <li><a href="[~[[GetField? &docid=`[[UltimateParent]]` &field=`id`]]~]" title="[!GetField? &docid=`[[UltimateParent]]` &field=`menutitle`!]">[!GetField? &docid=`[[UltimateParent]]` &field=`menutitle`!]</a> [!Wayfinder? &startId=`[[UltimateParent]]` &excludeDocs=`1` &hideSubMenus=`1`!] </li> </ul>
As I stated above, there may be a more elegant solution to this issue and I would love to hear it if there is. But one of the MODx strengths I believe this issue illustrates is just how flexible the this framework is to work with. With MODx there can easily be multiple solutions any issue.
Addendum 11/06/09 — Check out the comments on this post for the “more elegant solution” that I had been hoping for.



Sorry, you want to show the children and just their parent? Am I understanding that right?
November 5th, 2009 at 3:51 pm
Yes, for instance this site has 4 primary containers in which the site resides. If I am in any container I want to see the active Parent and all it's children.
November 5th, 2009 at 3:54 pm
Add to your wayfinder call &displayStart=`TRUE`
&startItemTpl=`yourtemplatename`
I think that will do what you want.
As an aside, the ebook “The (almost) Complete Guide to Creating Menus in
MODx using Wayfinder” is awesome.
[PDF]
http://modxcms.com/forums/index.php?action=dlat...
November 5th, 2009 at 4:31 pm
That works like a charm too. Definitely a preferable approach. Thank you NICCAI.
November 5th, 2009 at 6:02 pm
Sorry, you want to show the children and just their parent? Am I understanding that right?
November 5th, 2009 at 9:51 pm
Yes, for instance this site has 4 primary containers in which the site resides. If I am in any container I want to see the active Parent and all it's children.
November 5th, 2009 at 9:54 pm
Add to your wayfinder call &displayStart=`TRUE`
&startItemTpl=`yourtemplatename`
I think that will do what you want.
As an aside, the ebook “The (almost) Complete Guide to Creating Menus in
MODx using Wayfinder” is awesome.
[PDF]
http://modxcms.com/forums/index.php?action=dlat...
November 5th, 2009 at 10:31 pm
That works like a charm too. Definitely a preferable approach. Thank you NICCAI.
November 6th, 2009 at 12:02 am