Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Get Posts by Tags Querystring Operators

  • #3659
    Avatar photo[anonymous]

    I’m trying to get posts by a specific combination of tags and I’m wondering if the querystring in the #GetPostsbyTags helper can accept operators in some way? For example I have posts with the tag About and some with the tag City but want to only display posts that contain About AND City filtering out any posts that contain only one of the tags. I attempted to achieve this using the {{#checkIf}} method of getting posts by specific tags but nesting the {{#checkIf}} helper doesn’t seem to work such as in the example below…

    {{#each @website.contentStructure.tags}}
      {{#checkIf this.name '==' 'About'}}
        {{#checkIf this.name '==' 'City'}}
          {{#each this.posts}}
            {{text}}
          {{/each}}
        {{/checkIf}}
      {{/checkIf}}
    {{/each}}

    Any help is appreciated!

    #3662
    Avatar photo[anonymous]

    Hi,

    Unfortunately it is not possible at this moment with getpostsbytags but I see if it is easily possible to add an operator param which will allow OR and AND values to solve your issues, because it is a good idea 🙂

    #3663
    Avatar photo[anonymous]
    #3695
    Avatar photo[anonymous]

    Awesome! Excited to see this feature in a future release, thank you!