-
- 62 Posts
I would like to use the the same template but change the document root during the parsing process (I use DropMenu).
I have two different menus
root 1
-->Home
-->Submenue
-->Submenue
....
root 2
-->(need a link to Home of root 1)
-->Submenue
-->Submenue
I can imagine that the changing of the docroot can be done during the parinsg by a plugin and changing the variable-value for the startDoc-Parameter
But how to create the link to the Home-item - the menu is automatically generated and I don’t want to copy the home-document within MODx to the second menu (that would be a bad workaround)
-
- 4,213 Posts
What are you actually trying to do? Do you have for example top menu somewhere and you want to build a side menu under each topmenu section? Or multilanguage site? or what?
The two above are easy to do when using UltimateParent (for top/side menus) or SectionRoots (for multilanguage) snippets in the value of startDoc, like [!DropMenu? &startDoc=`[[UltimateParent]]` ... !]
If you want the Home link allways be in the side menu, check the "show in menu" off and put the link manually to the template before the dropmenu built menu, so it’s allways there. Or you could do weblinks under the different sections what points to your home page.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
-
- 4,213 Posts
Still don’t quite understand what you want to do.. You want the menu to change to some other in some section etc? why not just use different startDoc values, possible generated by some other snippet?
Or do you want that users can change the menu them self on any page by selecting some link? then maybe have 2 separate menus allways and hide/display them with css and javascript.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
Replace that DropMenu call with a TV maybe named MainMenu. In the TV put the DropMenu call, and specify the &startDoc value. Now you can edit that startDoc value for every page. The @INHERIT binding is very handy here, you only have to edit the parent folders for each child document to have the same menu.