We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17673
    • 194 Posts

    if the TV on which filtering is active contains name/value pairs:

    name1==value1||name2||name3==value3

    a filter clause such as:

    &filter=`DittoFilter,name3,7` fails, checking with debug it seems that Dittofilter now contains value3, instead of name3; ..I was trying to have a call to another snippet as value3

    ciao, have a good Week-end
      ----------------------------------------------------------
      http://www.linkedin.com/in/lucapost/
      http://www.twitter.com/lukwe/
      ----------------------------------------------------------
      • 6726
      • 7,075 Posts
      What are you tring to accomplish here ? It would help us help you...

      It does contain value3 because you set it that way when you built your TV (e.g name3==value3 means you’re setting the value of name3 to value3).
      Your filter should have been &filter=`DittoFilter,value3,7` (about mode 7 it depends what you need)

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


        MODx est l'outil id
        • 17673
        • 194 Posts

        ...say you want a filtered Ditto-call to create a list of articles containing a MaxiGallery slideshow.

        Once your editors have correctly chosen the DittoFilter TV-value for a document, they would (only) have to cut and paste the MaxiGallery call into the content; but they got scared of the ’’[[MaxiGallery ....]]’ string immediately and thus they’re not adding slide-shows!

        I was trying to add the MaxiGallery call automatically for any document whose DittoFilter TV was set to ’SlideShow’:
        I would define the DittoFilter TV with something like:

        ||Archived||LeftCol||RightCol||SlideShow==[[MaxiGallery parameters...]]


        and then use the standard call for Template Variables ’[*DittoFilter*]’ inside the article contents’. Aside from simplifing editors’ life this would also help the site-admin in maintaining/updating all MaxiGallery parameters at once for all SlideShow documents.

        Am I pushing Ditto outside its porposes ??!? I believe any snippet should treat name/value pairs in TV option-lists the same way as described in the general MODx documentation!

          ----------------------------------------------------------
          http://www.linkedin.com/in/lucapost/
          http://www.twitter.com/lukwe/
          ----------------------------------------------------------
          • 18397
          • 3,250 Posts
          Filtering works by removing all documents where x fields has y value. That said, there are several ways to achieve what you are attempting to do. I would try putting the MaxiGallery call in a chunk then calling it in the tv like so SlideShow=={{MaxiGallery}}. Then I would use `{{MaxiGallery}},name3,7` as the filter.
            • 17673
            • 194 Posts
            I believe you meant [tt]`DittoFilterTVname,{{MaxiGallery}},7`[/tt], right ?

            tried this and got into other troubles...

            chunk {{SlideShowMaxiG}} contains:
            [[MaxiGallery? &display=`embedded` &embedtype=`lightboxv2` &max_thumb_size=`264` &max_pic_size=`760` &max_pic_number=`8` &thumb_use_dropshadow=`1`]]

            the DittoFilter TV-values are defined as:
            ||Achive||LeftCol||RigthCol||SpotLight=={{SlideShowMaxiG}}

            and the filtered Ditto Call is:
            [[Ditto?parents=`13` &filter=`DittoFilter,{{SlideShowMaxiG}},7` &tpl=`DittoSpotlightTests` &randomize=`1` &debug=`1` &trunc=`1` &truncLen=`150` &truncText=`continua...`]]

            the output is:
            No documents found.
            ,DittoFilter,7` &tpl=`DittoSpotlightTests` &randomize=`1` &debug=`1` &trunc=`1` &truncLen=`150` &truncText=`continua...`]]

            seems like the ’]]’ inside the chunk are being interpreted by Ditto as the closing of its own call, resulting in a truncated sintax that ignores the parameters following the filter!

            I also tried using the HTML encoding ( &#91 for ’[’ ; &#93 for ’]’; and & for ’&’) inside the chunk, this do get rid of the truncation, but checking in Ditto-debug->parameters all MaxiGallery parameters are found (and the filter still fails)!?

              ----------------------------------------------------------
              http://www.linkedin.com/in/lucapost/
              http://www.twitter.com/lukwe/
              ----------------------------------------------------------
              • 18397
              • 3,250 Posts
              Try alternating between cached and uncached calls. Say the Ditto call uncached and MaxiGallery cached.
                • 27376
                • 576 Posts
                What you need is a sort of "Tag Parser" that will take value1,2,etc and translate it to name1,2,etc. I have the same problem and am working on a solution.

                No time set as to when I will finish it, but Mark gave me a good starting point in the linked thread above.
                  • 17673
                  • 194 Posts

                  Thanks Sirlancelot, I was keeping an eye on that thread already!

                  To sum it all up into a consistent, bullet-proof tagging system I would:


                  • use MODx’s own ’site_keywords’ SQL table instead of extra TVs/TABLEs (&keywords=’1’ &tagData=’keywords’)
                    i.e. better integration with MODx backend by exploiting its own metadata for documents


                  • output Technorati-compatible rel-tag links for tags
                    conforming to web standards and enhancing SEO indexing




                    ----------------------------------------------------------
                    http://www.linkedin.com/in/lucapost/
                    http://www.twitter.com/lukwe/
                    ----------------------------------------------------------