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

    I new to modx and I have been using a tags TV to try and organise my website. I want to create a button that directs you to a list of documents labelled by one specific tag. I have created a new document to display the results and I have linked the image to that page. I then used the following script where I want the results to appear:

    <div id="content_text" style="text-decoration: none;">[[!getResources?
    &includeTVs=`1`
    &tv=`tags`
    &tvFilter=`tags==Sundarbans`
    &parents=`9`
    &hideContainers=`1`
    &tpl=`sundarbansPost`
    &limit=`100`
    ]]

    [[!+page.nav:notempty=`
    <div class="paging">
    <ul class="pageList">
    [[!+page.nav]]
    </ul>
    </div>
    `]]</div>

    Where tags is the name of the TV and Sundarbans is the specific tag I want to find resources for. No results display on the page when the button is selected. Am I using the right code for what I want to achieve? Any help would be really appreciated.
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Do you only have one tag in the tags tv?

      That search searches for resources where the TV is exactly "Sundarburns".

      Use
        &tvFilter=`tags==%Sundarbans%` 

      to search for anything that contains your tag.

      That will cause tags like "Development" matching "Web Development" too tho.

      If you’d rather not have that, you’re probably looking at creating your own snippet to get matching resources, explode the tags tv by the delimiter, and see if it still matches using in_array(..,..) and only return it then.
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 13803
        • 5 Posts
        Thanks for the reply. I’ve put the % into the code and it works fine.
        The term Sundarbans does not appear in any of the other tags so it should be OK.