We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22019
    • 390 Posts
    I think this may be a bug: http://bugs.modx.com/issues/3365 but I’m struggling with finding a workaround.

    I have a listbox(multi-select) TV - use_Property, with options -
    Retail||Restaurant||Office||Other


    I output them in a chunk that calls the placeholder
    [[+tv.use_Property]]


    If more than one option is selected, it outputs like this:

    Retail||Restaurant


    I’ve tried to set Output to Delimiter (and a comma for the delimiter).
    I’ve tried to use an output modifier
    [[+tv.use_Property:replace=`||==,`]]

    but I can’t get :replace to do anything at all....

    Any other thoughts? I could, obviously, create more than one ’use_Property’ TV, but I want to search across this field. Should I use auto-tag instead, even though it gives the client more options?
      Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
      • 3749
      • 24,544 Posts
      That return value is normal for that kind of TV. Try setting the Output as "Delimiter" but don’t specify a delimiter. It should default to a comma.

      You could also write a snippet or a custom output modifier to parse the TV. How, exactly, would you like it to look when displayed in the front end?


        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
        • 22019
        • 390 Posts
        That doesn’t work, Bob. At least not on 2.0.7.

        I want it to display in the front end
         Property name - use1, use2


        The output is almost what I want when I use autotag as the TV, albeit with no space after the comma
        Property name - use1,use2


        I can live with that, although it means that I would have to autopopulate a dropdown filter (or use tags) when I create some kind of interface to filter on those options to generate a list - I’m thinking either as a where clause, or use taglister to try and fudge it (although my understanding of tagLister is that it doesn’t do ’or’ joins - if it does joins at all).
          Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
          • 3749
          • 24,544 Posts
          I’m not sure about tagLister, but I think might get the output you want with this:

          [[!ShowTv? &tv=`[[+tv.use_property`]]


          <?php
          /* ShowTv Snippet */
          return str_replace('||', ', ', $tv);


            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
            • 15558
            • 108 Posts
            Hi there,

            Old thread for a probably old question :

            would it be possible to include in some next Revo release a function that would permit to choose its own "Wrapper" (or wrapper(s)) instead of a "Delimiter" ? Therefore low-skilled people like me would be able to use that TV without annoy the forum asking : how does one parse the values that are output ?
              Sorry for that ⇧ , I'm no dev but I wanna try