We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27889
    • 415 Posts
    I think it’s a good choice to have only one snippet with lot of parameter, it let the choice to the user. Perhaps the author of the original DropMenu is ok to implement your work.
    It’s afraid me to have lot of snippets with lot of hacks with lots of versions embarrassed

    Can you help me for the example use of the keywordRegexp parameter.
    I want’t discard page keyworded with ’blog’, ’news’ and allow those with ’site’ and ’web’
      MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
      MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
      • 25663 MODX Staff
      • 12,272 Posts
      DropMenu is currently "under the knife" so to speak and will be replaced by a much simpler and more flexible version very soon. Feel free to hack it up as you see fit in the interim. wink
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 19986
        • 90 Posts
        Quote from: Soda at Jul 11, 2006, 09:28 AM

        I think it’s a good choice to have only one snippet with lot of parameter, it let the choice to the user. Perhaps the author of the original DropMenu is ok to implement your work.
        It’s afraid me to have lot of snippets with lot of hacks with lots of versions embarrassed

        Can you help me for the example use of the keywordRegexp parameter.
        I want’t discard page keyworded with ’blog’, ’news’ and allow those with ’site’ and ’web’

        Here are a couple of examples, which are pretty much a cut-and-paste job from my setup. Obviously change the details of any variables (and snippet name) if they’re different in your setup.

        The following will only output items which have ’site’ or ’web’ in a template variable called ’keywords’:

        [!DropMenuMindspillDotNet? &startDoc=`[*id*]` &levelLimit=`1` &here=`current` &selfAsLink=`true` &showDescription=`true` &showAllInMenu=`true` &useWeblink=`true` &tvRegexpField=`keywords` &tvRegexpString=`(site|web)`!]

        The following will only output items which don’t have ’blog’ or ’news’ in a template variable called ’keywords’:

        [!DropMenuMindspillDotNet? &startDoc=`[*id*]` &levelLimit=`1` &here=`current` &selfAsLink=`true` &showDescription=`true` &showAllInMenu=`true` &useWeblink=`true` &tvRegexpField=`keywords` &tvRegexpString=`(blog|news)` &joinMethod=`not`!]

        Bear in mind that because of the way MODx stores template variables in the database (i.e. it doesn’t if it’s value is blank), you should give the ’keywords’ TV a value every time you create a page, even if it’s something like ’-’.

        Hope that helps.

        Steph

          • 19986
          • 90 Posts
          Oh sorry, you were talking about the keywordRegexp parameter. In that case...

          The following will only output items which have ’site’ or ’web’ in the keywords:

          [!DropMenuMindspillDotNet? &startDoc=`[*id*]` &levelLimit=`1` &here=`current` &selfAsLink=`true` &showDescription=`true` &showAllInMenu=`true` &useWeblink=`true` &keywordRegexp=`(site|web)`!]

          The following will only output items which don’t have ’blog’ or ’news’ in the keywords:

          [!DropMenuMindspillDotNet? &startDoc=`[*id*]` &levelLimit=`1` &here=`current` &selfAsLink=`true` &showDescription=`true` &showAllInMenu=`true` &useWeblink=`true` &keywordRegexp=`(blog|news)` &joinMethod=`not`!]
            • 7923
            • 4,213 Posts
            Quote from: steph at Jul 11, 2006, 09:16 AM

            Official MODx people... Should I put this in the repository?
            I’m not a official team member, but in my opinion, ALL resources should be in the repository. This is a snippet (even though it needs core hacks to work) and should be added as such. Hacks from some allready made snippet could be added as the "Extras" of that particulary snippet, but dropmenu has not been added to the repository yet. Actually none of the core snippet has been added yet, don’t know why.

            @modx team
            It would be good if the current core distribution of dropmenu would be added to the repository and then all the available hacks of it could be added as extras. I’ve made a list of some here, don’t know are they all there. Also the other core distribution snippets/modules/plugins should be added to the repository too, right?


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."
              • 25663 MODX Staff
              • 12,272 Posts
              You’re exactly correct doze... want to add it? tongue
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 7923
                • 4,213 Posts
                Quote from: rthrash at Jul 11, 2006, 10:46 AM

                You’re exactly correct doze... want to add it? tongue
                Yes, I can add it, I’ll do it right away.. or did you mean to add all core distribution resources? I can do that also if needed.

                Hmm, if snippet has multiple developers, how to add it? I mean that will the repository parse the authors correctly to search filters if used some known delimiter?


                  "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                  • 27889
                  • 415 Posts
                  Thanks thanks for the examples, you could put it with the others in the code, it help a lot.
                  Users: Don’t forget to replace [tt]&[/tt] with [tt]&[/tt]
                    MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
                    MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
                    • 27889
                    • 415 Posts
                    Perhaps put all the files in the same archive, with a description for each:

                    • a file with the original plugin
                    • a file for each different hacks (one per hacker)
                    It implies the coders work together or have access to add, remove the files in the repository. Difficult but in my opinion the result is good.
                    Each user can choose what they want.
                    A system as sourceforce can be good too. (A new module for MODx ?)
                      MODx Sites & Prestations: http://dp-site.fr [Last MODx Site]
                      MODx Repository: [HOME] [MetaTagsExtra] / Current Dev: [xFDM]
                      • 7923
                      • 4,213 Posts
                      Quote from: Soda at Jul 12, 2006, 02:34 AM

                      Perhaps put all the files in the same archive, with a description for each:
                      ....
                      Yes, I was trying to get the "base" version of DropMenu to the repository so that all these different versions could be added as "extras" like here (scroll down to see the extras). But there is a slight problem preventing me to do this.

                      I can’t add the core distribution snippets to the repository, because the author field and filtering resources by it will be messed up. The repository needs an update where it’s possible to define multiple authors and get them from smf database so they will get the correct id’s.. But I’ll let you know when I (or someone else) have uploaded dropmenu to the repo.. There might be a solution in the interim that we use some "team" user to add these resources, but I’m not too happy with that solution, because it will still mess up the resouce filtering feature.

                      But stay tuned, I hope this can be solved quickly..


                        "He can have a lollipop any time he wants to. That's what it means to be a programmer."