We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4273
    • 356 Posts
    This is perhaps reaching for the stars and difficult to explain but can dropmenu be made to insert into template as an undefined menu set (until activated) then according to the document add something that would pull in specified set of menus ?

    ie

    the menus in the page would be related links and instead of having to add a drop menu per doc, per category is there someway I can add just a small code that would activate the dropmenu already current in template ?

    simply put would like to have a dropmenu already in the template as a container for related links then according to the doc or category just add something to the document that would make the dropmenu set for the particular link set

    I’m uncertain if this can be possible
      SMF Bookmark Mod - check it out
      http://mods.simplemachines.org/index.php?mod=350
      • 6726
      • 7,075 Posts
      Hmmm, interresting. One way to do it would be to use dynamic parameters (such as [~[*id*]~] ) in your DropMenu call... I’ll let more expert people give you some hint on this, since I did not experiment with it I wouldn’t point you in the wrong direction...

      Also : this variant of DropMenu could help you achieve the related links part of your question :
      [snippet] DropMenu. Modified for weblinks and regexp on keywords/TV


        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l'outil id
        • 10487 MODX Staff
        • 1,535 Posts
        I think [~[*id*]~] won’t work at the moment because the parser doesn’t handle nested tags (although might be wrong - I haven’t tried it to be honest)

        One way would be to write a plugin that would inject the value of the current ID into the tag (or the whole tag into the document if required) and assign the plugin to an event that runs before the document is parsed. It would take a bit of work to get it up and running but would do the job.

        I suppose it depends if that’s going to be easier than assigning the dropmenu tags at page level. wink
          Garry Nutting
          Senior Developer
          MODX, LLC

          Email: [email protected]
          Twitter: @garryn
          Web: modx.com
          • 28373
          • 204 Posts
          Quote from: garryn at Apr 05, 2006, 04:47 PM

          I think [~[*id*]~] won’t work at the moment because the parser doesn’t handle nested tags (although might be wrong - I haven’t tried it to be honest)

          One way would be to write a plugin that would inject the value of the current ID into the tag (or the whole tag into the document if required) and assign the plugin to an event that runs before the document is parsed. It would take a bit of work to get it up and running but would do the job.

          I suppose it depends if that’s going to be easier than assigning the dropmenu tags at page level. wink

          I really wish I knew more php - if I could find a way of giving each page or folder the ability to assign it’s own ID or class then styling for special occasions wouldn’t need as many hacks on the drop menu script. I know it’s not a dynamic solution but for the number of hacks available including our own it wouldn’t have been necessary if a static assignment existed. So that would mean 2 extra fields for the document setup, and the script to assign id’s or class if they’re not empty - does that sound too far fetched or flawed ?
            • 11413
            • 203 Posts
            I’m doing something similar on my website. Here is what I do :

            I create a TV wich holds the ID of the directory where the DropMenu will get its data and I declare it like that :

            [[DropMenu?startDoc=[*MyTV*]&levelLimit=1&... ... ...]]

            This way, you can define a different directory ID for each page and you can even use the @inherit binding to put the same menu on childrens too.

            Hope this helps!
              Blaise Bernier

              www.medialdesign.com - Solutions for small business, hosting, design and more!
              • 4273
              • 356 Posts
              wow do I have to brush up on my MODX terminology, didni’t understand a word that any of you said he he

              I too would like to see the dropmenu be more customizable would be excellent to define specific items within the snippet and also CSS.

              since the snippet itself is not the actual links its sometimes difficult because we can’t see the actual item we want to style unless its in the browser
                SMF Bookmark Mod - check it out
                http://mods.simplemachines.org/index.php?mod=350
                • 6726
                • 7,075 Posts
                Quote from: grunt_lord at Apr 05, 2006, 06:16 PM
                I’m doing something similar on my website. Here is what I do : I create a TV wich holds the ID of the directory where the DropMenu will get its data and I declare it like that :

                [[DropMenu?startDoc=[*MyTV*]&levelLimit=1&... ... ...]]

                This way, you can define a different directory ID for each page and you can even use the @inherit binding to put the same menu on childrens too.Hope this helps!

                A nice demonstration of what can be done with MODx grin !
                I bookmarked it and most definitely will use this (this kind of trick does belong in the Tips and Trick section !!!)

                The only question is : what’s the setting of your TV ? do you use the API to get the document ID automatically into that TV ? Or is it manually inserted for each document ?
                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l'outil id
                  • 28373
                  • 204 Posts
                  Quote from: bugsmi0 at Apr 05, 2006, 08:18 PM

                  wow do I have to brush up on my MODX terminology, didni’t understand a word that any of you said...

                  your not alone, I think we’ll revisit this once we’ve got handles on the terminology and the other little tricks modX is capable huh
                    • 11413
                    • 203 Posts
                    The only question is : what’s the setting of your TV ? do you use the API to get the document ID automatically into that TV ? Or is it manually inserted for each document ?

                    I insert it manually, but I could’ve also created a snippet that would detect the parent of the document and use it as the ’top level’ of the menu, but I wanted to have something more definite. My website is divided in 2 parts (french and english) and each of these sections uses the same templates. So, I have a few template variables with @inherit bindings that are used to reference the good folders and documents. I only use an integer TV and I enter it manually, but I guess you could set it to detect the ID of the parent by using the @EVAL binding and call the $modx->document object to retrieve the info.
                      Blaise Bernier

                      www.medialdesign.com - Solutions for small business, hosting, design and more!
                      • 6726
                      • 7,075 Posts
                      Thanks for your answer, pretty helpful there laugh !
                        .: COO - Commerce Guys - Community Driven Innovation :.


                        MODx est l'outil id