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

    I use getResources & TaggerGetResourcesWhere snippet.

    It seems to me tagger multiple tags passed as TaggerGetResourcesWhere params return results with OR operator. Is there a way to use AND, instead?

    [[!getResources?
    &parents=`22`
    &tpl=`tpl-collections-row`
    &showHidden=`1`
    includeTVs=`1`
    &where=`[[!TaggerGetResourcesWhere? &groups=`taggerGroup1` &tags=`tag1,tag2`]]`
    ]]
    


    &tags=`tag1,tag2` => OR
      MODX lover
      -
      Développeur MODX / Webdesign / Solutions web
      • 3749
      • 24,544 Posts
      Try this

      [[!TaggerGetResourcesWhere? &groups=`taggerGroup1` &tags=`tag1,tag2` &matchAll=`1`]]


      I'm not sure the version with that enhancement has been released.


        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 46580
        • 167 Posts
        Quote from: BobRay at Dec 13, 2014, 09:37 PM
        Try this

        [[!TaggerGetResourcesWhere? &groups=`taggerGroup1` &tags=`tag1,tag2` &matchAll=`1`]]


        I'm not sure the version with that enhancement has been released.



        Ok, it work with Tagger 1.6, excepting when a non-existing tag in Tagger db (extras / tagger / tags) is passed : logically &where query should return empty result because tag-non-existing-in-tagger doesn't exist as tagger tag, but it returns tag1 & tag2 results.

        &where=`[[!TaggerGetResourcesWhere? &tags=`tag1,tag2,tag-non-existing-in-tagger` &groups=`taggergroup1` &matchAll=`1`]]`


        tag-non-existing-in-tagger is ignored as AND statement and the query returns tag1 AND tag2 as results instead none (there is no resources matching tag1 AND tag2 AND tag-non-existing-in-tagger).

        A question : usually is snippet param order is important ?
        &tags=`tag1,tag2,tag-non-existing-in-tagger` &groups=`taggergroup1` &matchAll=`1`
        =
        &matchAll=`1` &tags=`tag1,tag2,tag-non-existing-in-tagger` &groups=`taggergroup1`

        [ed. note: johnxx last edited this post 9 years, 4 months ago.]
          MODX lover
          -
          Développeur MODX / Webdesign / Solutions web
          • 3749
          • 24,544 Posts
          No, AFAIK, the order of the properties never matters.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting