We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22827
    • 129 Posts
    Am I right in thinking that the built-in conditional output filters aren't going to work with multi-select TVs?

    In other words, I can't do this:

    Multi select TV *colour:  Blue==blue||Red==red||Yellow==yellow


    [[*colour:eq=`yellow`:then=`Yellow was one of the selected options`]]
      • 36996
      • 211 Posts
      [[*colour:eq=`yellow`:then=`Yellow was one of the selected options`:else=`[[-]]`]]

      try to pass an else value.


      Edit: original answer was wrong.
        • 22827
        • 129 Posts
        Quote from: nir-z at Jun 10, 2014, 01:32 AM
        [[*colour:eq=`yellow`:then=`Yellow was one of the selected options`:else=`[[-]]`]]

        try to pass an else value.

        Sure - I'll put in an else value if this approach works with multi-selects. But given that a multi-select returns an array, can it be said to be equal to anything?
          • 4172
          • 5,888 Posts
          you can create a custom-output-filter or use the If-snippet

          [[If?
             &subject=`yellow`
             &operator=`inarray`
             &operand=`[[*colour:replace=`||==,`]]`
             &then=`Yellow was one of the selected options`
             &else=``
          ]]
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 36996
            • 211 Posts
            Sorry, this will not work for multi-select.
            What you need is a customoutput filter - http://rtfm.modx.com/revolution/2.x/making-sites-with-modx/customizing-content/input-and-output-filters-(output-modifiers)/custom-output-filter-examples

            Edit: Didn't see Bruno's answer.. [ed. note: nir-z last edited this post 12 years, 3 months ago.]