We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43054
    • 15 Posts
    Hello, tell me about tvFilters in getResources
    If I need to make a selection on the multiple values ​​of a single TV
    Lets say "Countries" need only select the USA and Germany. Implementation of "country==USA,country==Germany" does not work.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      That's because your TV has a list of values, not a single value to compare against. The TV filter works with the raw content of the TV. You'll need to have a fairly complicated filter expression, something like
      country==%USA%,country==%Germany%
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 43054
        • 15 Posts
        nope i have a single list value, and your try don't help)i sorry maybe i some understand
        $params['tvFilters'] = "country==%USA%,country==%Geramny%";
        - no work
        $params['tvFilters'] = "country==%USA%"; 
        work good... but not i need )
          • 36996
          • 211 Posts
          I think you need to use the OR filter:
          country==%USA%||country==%Geramny%


          Or, if you need multiple values, you can set your tv values as: *USA*, *Germany*
          and the the filter:
          country==%*USA*%||country==%*Geramny*%
          [ed. note: nir-z last edited this post 13 years, 6 months ago.]
            • 43054
            • 15 Posts
            Ohhh thank you! Receive using the OR, not try because I thought it logically does not fit the principles of SQL, as OR will print or 1 or 2
              • 36996
              • 211 Posts
              For the second option I should have written
              country==%*USA*%,country==%*Geramny*%
                • 43054
                • 15 Posts
                not try, but first working to
                  • 36996
                  • 211 Posts
                  Great!
                    • 43054
                    • 15 Posts
                    question for the future, the second option for multiple choice? like checkbox?
                      • 36996
                      • 211 Posts
                      Yes, for checkbox or multi-select listbox.
                      Since there is no support for the IN operator at the moment.