We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22827
    • 129 Posts
    Hello,

    If I have a TV 'color' that is a listbox, like:
    Red==1||Blue==2||Green==3


    The stored value of the selected TV is 1, 2 or 3. What would like to display is the title of the TV value. So if 2 was stored, I could output

       [[*color:title]] 


    So instead of displaying '2' it displays 'Blue'.

    Is this possible without a snippet or custom output filter?

    Thanks.

    This question has been answered by paulkoan. See the first response.

      • 3749
      • 24,544 Posts
      The simplest solution would be to just change the Input Option Values to this, if that would work for you:

      Red==Red||Blue==Blue||Green==Green


      or

      Red||Blue||Green



      If you need the values to be numbers for some reason, you'd have to either hard-code all possible translation values into a custom output modifier or (in the output modifier) get the TV object, get its Input Option Values field, parse that field, and return the appropriate string. The second method might slow down page loads enough to be noticeable if you have very many TVs on a page.


      ------------------------------------------------------------------------------------------
      PLEASE, PLEASE specify the version of MODX you are using.
      MODX info for everyone: http://bobsguides.com/modx.html

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
      • discuss.answer
        • 22827
        • 129 Posts
        In this instance, changing the input values isn't an option. However, it looks like someone else has had the same idea and created an output filter:

        http://modx.com/extras/package/gettvdisplayname