We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7455
    • 2,204 Posts
    This snippet find its way back to a folder that you can specify in the snippet call or in the config below
    and displays that id number. Great to set different roots for DropMenu for instance when making
    a multilangual site where the root must not be 0 but the folder of the language that is active.
    e.g. [[SectionRoots?Sec_roots=1,2,3,4,5,6]] if none is found it wil return 0
    Based on ListSections made by Jared

    Dimmy
      follow me on twitter: @dimmy01
      • 17883
      • 1,039 Posts
      Hi Dimmy,

      thx for sharing! One question: How do you call it for the dropmenu snippet? Directly in the dropmenu-call or via TV? Because it doesn´t work here when I put it directly in the dropmenu call. Nor with TV. This one here doesn´t work:

      [!DropMenu? &menuName=`topMenu` &startDoc=`[!Sectionroots?Sec_Roots=14,16!]` &titleOfLinks=`menutitle` &levelLimit=`1` &topnavClass=`topMenubar` &selfAsLink=`true` &hereClass=`activeLink`!]


      Obviously it´s not possible to call a snippet within a snippet?

      Thx in advance
      Marc
        • 6726
        • 7,075 Posts
        Quote from: MadeMyDay at Mar 30, 2006, 02:29 PM
        Obviously it´s not possible to call a snippet within a snippet?

        Not yet, but Raymond is working on the recursive parser which (if I understood correctly) will allow for this kind of snippet call grin
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 17883
          • 1,039 Posts
          I´m not surprised smiley
            • 7455
            • 2,204 Posts
            actualy it works great for me

            but call it like this:
            [!DropMenu? &startDoc=`[[SectionRoots?Sec_roots=1,2,3,4,5,6,108,118,144,161,174,190]]`&subdiv=true &subdivClass=nav2!]

            some other exaples of this snippet I used one this site:
            [!ListGlobal?LGlob_node=[[SectionRoots?Sec_roots=106,107]]!]
            <link href="css/basic_[!SectionRoots?Sec_roots=106,107!].css" rel="stylesheet" type="text/css" media="all" />
            <img height="43" src="assets/images/menulijnen/toplijn_[!SectionRoots?Sec_roots=106,107!].png" width="825" alt="" />

            to make a snippetcall function within a snippet call you must call it like [[snippet]] instead of[!snippet!] for it to work.

            working on this site http://danielson.tidestream.com

            go here for the german part (still in translation)

            http://danielson.tidestream.com/index.php?id=111

            will be in dutch english german and french

            all done with one template

            p.s. also only 1 dropmenu the same call for the submenu and the subsub menu on the right: http://danielson.tidestream.com/index.php?id=139

            for the top menu I used ListGlobal (see call above)
              follow me on twitter: @dimmy01
              • 7923
              • 4,213 Posts
              Niceness, Dimmy! Very good menu usability on the site, I like it alot. Good job!


                "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                • 17883
                • 1,039 Posts
                Thx Dimmy, have to try out tomorrow, a test usage failed. Think I forgot something else smiley

                But thank you, this is a very handy thing especially for multilingual content.

                Marc
                  • 6726
                  • 7,075 Posts
                  Agreed, a very nice thing indeed, and great idea to use this for multilingual !
                  Another MODx easter egg, calling a snippet from withing a snippet, how did you find that ? Done some documentparserclass reading ?? Should do that one day...

                  Anyway, I have to try this too...
                    .: COO - Commerce Guys - Community Driven Innovation :.


                    MODx est l&#39;outil id
                    • 4273
                    • 356 Posts
                    is sectionroots something that can be used like this

                    folder 1 <- include as topmenu in dropmenu
                    doc-a
                    doc-b
                    doc-c

                    the dropmenu won’t call the folder only the docs inside the folder

                    as a makeshift i had to create an additional folder to contain all then refered to the top folder

                    the idea was to have your main menus that appear then the docs as related pages
                      SMF Bookmark Mod - check it out
                      http://mods.simplemachines.org/index.php?mod=350