We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18397
    • 3,250 Posts
    Can you try calling it in a document and not in the template just to simplify diagnosing things? Let me know if that works.
      • 36451
      • 264 Posts
      I really like the new tagging feature of Ditto and use it to filter and show documents stored in different subfolders. My snippet call is
      [!Ditto? &startID=`46,50,51,52,53` &tpl=`glpGoodPracticeSearchResults` &hiddenTVs=`Categories` &tagData=`tvCategories` &tagDelimiter=`,` &tags=`vehicles,Germany` &tagMode=`onlyTags` &summarize=8 &paginate=`1` &truncText=`Details...` &debug=1!]
      The TV "categories" has some values like Germany||Poland||vehicles||IT etc.pp, the Output then is a simple comma separated list.

      Works like a charm. But it seems that my tags ("&tags=`vehicles,Germany`") are combined with a boolean OR. Is that right? I wonder if I could have an AND: "Please list only documents having both of my given tags." I read the Ditto documentation twice and also the snippet comments, but I found no information.

      For short: How to AND instead of OR with my tags? huh BTW, great snippet, Mark.
        • 7923
        • 4,213 Posts
        Quote from: yoomai at Jun 15, 2006, 07:49 AM

        For short: How to AND instead of OR with my tags? huh BTW, great snippet, Mark.
        Check the &tagMode parameter at the documentation, use &tagMode=`onlyAllTags`


          "He can have a lollipop any time he wants to. That's what it means to be a programmer."
          • 36451
          • 264 Posts
          Quote from: doze at Jun 15, 2006, 07:59 AM

          Check the &tagMode parameter at the documentation, use &tagMode=`onlyAllTags`
          This was the first thing I tried. The documentation of "&tagMode" is not self explanatory...
          Usage of the params resulted in:

          `onlyTags` - boolean OR
          `onlyAllTags` - nothing. Where are my tags?
          `removeAllTags` - nothing
          `removeTags` - nothing

          Where did I go wrong?
            • 18397
            • 3,250 Posts
            Can you try using a simple text field for your tv storage and report back if that works?
              • 26083
              • 32 Posts
              Hi,

              Get a problem:

              [!Ditto? &startID=`41` &tagData=`tvType` &tags=`Vaidya` &tagDelimiter=`,` &tagMode=`onlyTags` &hiddenTVs=`Type` !]


              Works well if Type is a text field, comma sepatated TV
              Do not works if Type is a multiple checkboxes TV

              Please note that I use UTF-8.
              Can it comes from a misinterpretation of the separator
                • 26083
                • 32 Posts
                I do want to dynamically filter from a sidebox selector. (a form with checkboxes)
                Can I then use something as :

                [! Ditto?  &tags=` $_REQUEST[categories]`
                  • 36451
                  • 264 Posts
                  Quote from: Mark at Jun 15, 2006, 09:15 AM

                  Can you try using a simple text field for your tv storage and report back if that works?
                  @Mark: It does not work, even if I use a text field instead of multiple checkboxes. I fired up phpmyadmin for having a look at "modx_site_tmplvar_contentvalues". If I use checkboxes, the values are stored as "Enterprise||vehicles||Poland". In case of using a text field it becomes "Enterprise,vehicles,Poland" - as I entered them.

                  With Ditto’s parameter "&tagMode=`onlyTags`" and "&debug=1" I have a detailed view on the results: My TV "categories" is in both cases a list of comma separeted values. Ummmh...

                  @Sam: Check out Bravados HowTo filter using GET-Params and Ditto: http://modxcms.com/forums/index.php/topic,398.msg36121.html#msg36121
                    • 26083
                    • 32 Posts
                    You are great - Will try this ...
                      • 10161
                      • 31 Posts
                      @Mark

                      I tried to put my Ditto snippet in a new page without any template, I always get the same message :

                      Parse error: parse error, unexpected $end in D:\web\modx\manager\includes\document.parser.class.inc.php(705) : eval()’d code on line 447

                      -> code in the document.parser.inc.php : $snip = eval($snippet);

                      I tried to use the snippet without any arg , i.e. [!Ditto!] or [[Ditto]], the same error occurs...

                      What’s up with my configuration ? undecided
                        Qui veut faire quelque chose trouve un moyen. Qui ne veut rien faire trouve une excuse.