Hello. I hope this isn’t the wrong section, I dont mean to double post or anything but it seems like there is more help here. I recently started using modx and I have looked through the documentation and forum but haven’t been able to find an answer to my question. Basically right now I got the wayfinder working with 1 level, in my design to create my main menu. For ease of explaining we will say these are Home, About Us, and Contact.
What I’m trying to do now is add a submenu, located on a different part of the page. So the About Us page might have 4 different sub pages.
I assume that the 4 pages would be put under the About Us in the tree structure. This is where I get lost, do I put the wayfinder in the main About Us and is there a way to include the child documents into that? Or do I put the wayfinder on each of the child documents?
Also, when you click About Us from the main navigation the page that loads is not About Us, but rather the first submenu item of About Us. I’m not sure how that plays into the structure of how the pages should be placed and how the wayfinder should be configured.
Finally, how do I ensure the the class=active stays activated for About Us on the main menu when navigating through the submenu? Will this happen naturally?
Thank you so much for your time.
-Roy
-
☆ A M B ☆
- 1,056 Posts
Try looking into Wayfinders’ &level parameter (e.g. &level=`2`)
Also, you can combine the &startId parameter with the UltimateParent snippet to achieve a separate Wayfinder menu for JUST the associated children
(e.g. &startId=`[[UltimateParent]]`)
Quote from: a2b2c2d at Jan 31, 2008, 12:37 PM
Finally, how do I ensure the the class=active stays activated for About Us on the main menu when navigating through the submenu? Will this happen naturally?
Yes. Wayfinder will apply the defined active class to all appropriate levels in the document tree’s hierarchy.
It shouldn’t require more than just two Wayfinder calls in your Template. (Not at the document level)
I dont want the submenu to show on all pages. I want no submenu on Home, I want an About Us submenu on the About Us section and a Contact submenu on the Contact section. Level is how deep I want it to go is my understanding. I want the submenu to be 1 level of the About Us pages. I would set the start ID to the About Us page I assume but how does that set when it should show and not show?
Would I have a wayfinder line for each submenu?
Maybe I am misunderstanding one of the variables...???
-
MODX Staff
- 2,502 Posts
You can create a Template variable to put the wayfinder call in or to reference a chunk with the wayfinder call for the submenu and make it on for those documents that you would like it active on...OR...you can make the default to on and then turn it off for those docs you don’t want it to be on.
Cheers,
Jay
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub