On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hey everyone,

    So i made a news page for a friend and used the 'Tagger' add-on to insert certain tags for specific news items.

    I found out that it is possible to filter tags with a URI like so:
    http://example.com/?tag=tagname


    And this works like a charm, but i was wondering (can't find anything on this in the documentation) if it's possible to filter on multiple tags aswell?

    http://example.com/?tag=tagname&tag2=tagname2


    Does anyone know if this is possible somehow?

    Thanks in advance!

    This question has been answered by niintek. See the first response.

    [ed. note: niintek last edited this post 1 year, 3 months ago.]
    • discuss.answer
      Ok, so i found out that Tagger does this job out of the box. The only drawback is that it works with an OR statement, this means that when your filter for 2 tags it will output any resource that matches one of these 2 tags.

      Example:

      User wants to filter on blogpost with tags 'News' AND 'New York'.

      What tagger does out of the box is creating URL parameters for both in this case:

      /blogs/?tags=news,new-york


      Unfortunately though it will display any resource with one of two tags, so it will show blogpost with tags 'News' and 'Los Angeles' as wel. It would be great if there will be a feature added where the OR statement will be replaced by an AND statement so when two tags are selected there will be only those visible that have an exact match with both tags.
      • Try adding this to the TaggerGetResourcesWhere tag:

        &matchAll=`1`
          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