We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18608
    • 112 Posts
    I have a specific problem where I hope someone can point me in the right direction.

    I have a list of projects on a site. On each project page there is a list of products that has been used in the specific case. The products has been selected in the manager on a multi-select listbox where the list is generated from the products displayed elsewhere on the site.
    That means that the listbox stores the products related to the project in a TV, and the raw data in the value field looks like this: id||id||id||id

    Now, what I would like to accomplish is that on the product pages I would like a box with "Projects this product has been used in:" and then a list of projects.

    I thought I could use this getResources call to generate the list:
    [[!getResources? &parents=`19` &limit=`5` &tpl=`relateredeProdTpl` &showHidden=`1` &depth=`2` &tvFilters=`anvendteProdukter==%[[*id]]%`]]


    Where the tvFilters parameter searches for any case of the pages id being present in the projects TV.
    BUT this only works when there is one id listed in the TV and only in some cases... If there is more than one id seperated by ||, it never works...

    Any ideas on how to solve this?

    (On MODX 2.2.6 and latest edition of getResources)
      Mathias Dannevang | Webdesigner at dannevang.org | Tweets @dannevang
      • 37242 ☆ A M B ☆
      • 339 Posts
      Did you try and output the tv as text? What does it say?
      As ID comes from the TV, did you try +id instead of *id?
        • 18608
        • 112 Posts
        Quote from: gallenkamp at Dec 19, 2012, 05:06 PM
        Did you try and output the tv as text? What does it say?
        It is set as a comma delimited list, so outputting it returns the id's at it should seperated by commas.
        As ID comes from the TV, did you try +id instead of *id?
        I use the target parameter to match by, so *id is what I want, since the test should be if the current resource ID is present in the TV's list of ID's..
          Mathias Dannevang | Webdesigner at dannevang.org | Tweets @dannevang
          • 40131
          • 40 Posts
          Have a look at this post. It should solve your problem:

          https://forums.modx.com/thread/43706/getresources-tvfilters-not-working-solved?page=2#dis-post-450644

          As well, you should not use &limit=`5`, but &limit=`0` if you want to list all tagged documents. [ed. note: nickyz last edited this post 13 years, 9 months ago.]