We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36671 ☆ A M B ☆
    • 120 Posts
    Modx Revo 2.2.7

    I have created a multi-select TV of type Listbox (multi-select) with the following Input:

    Junior Infants==juniors||Senior Infants==seniors||First Class==first||Second Class==second||Third Class==third||Fourth Class==fourth||Fifth Class==fifth||Sixth Class==sixth||School Trips==trip||Green Schools==green||Active Schools==active||Primary Science==primary||Projects==projects||Performances==performances||Fundraising==fundraising||Archives==archive||Uncategorised==uncategorised

    Output is set to Delimiter with the delimiter field currently left blank

    When I use the tv in my code, it returns the output correctly but with 2 pipe symbols as delimiters, e.g. class="first||green||fundraising". I just can't get rid of them. I've tried setting the delimiter field to another symbol, just to test it out but nothing changes. I just want simple spaces between the items.

    BY the way, have also tried to leave out the options, ie. just juniors||seniors||first etc. as Input Options but no difference. Also tried this on another site and same issue.

    Any suggestions appreciated. [ed. note: intandem last edited this post 13 years, 5 months ago.]
      • 3109 ☆ A M B ☆
      • 894 Posts
      Insert a non breaking space html code as the delimiter and it will render like you wan't on the front end.
       
      


      Hope that solves your issue.
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 36671 ☆ A M B ☆
        • 120 Posts
        That was the first thing I tried but unfortunately it did not get rid of the pipe symbols. But thank you for your suggestion nonetheless smiley

        Got this short snippet code from Bob Ray however that did the trick - in case its of use to any other php numpties like myself:

        return str_replace('||', ' ', $input);


        I called the snippet pipestospace and added :pipestospace to my TV tag. That did the trick. However, still confused why there are pipe symbols in the first place as nothing in the docs tells me that this is a default. I wonder if this is a Revo version issue? Must do a test in an older version and otherwise report as bug. [ed. note: intandem last edited this post 13 years, 5 months ago.]
          • 4172
          • 5,888 Posts
          '||' is and was also on EVO the delimiter of array-TV-values like listbox-multiple and checkbox - TVs in the db.

          you can also try the replace - output-filter:

          [[*yourTV:replace=`||== `]]
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 3109 ☆ A M B ☆
            • 894 Posts
            It might be something to do with your install because I just checked on a 2.2.6 and a 2.2.7 site I have and inserted your exact same code and it works fine on both.

            Very weird.
              Benjamin Marte
              Interactive Media Developer
              Follow Me on Twitter | Visit my site | Learn MODX
              • 1331
              • 129 Posts
              Quote from: intandem at May 19, 2013, 10:08 AM


              Output is set to Delimiter with the delimiter field currently left blank


              I think your delimiter is the double-pipe. Maybe?
                • 47243
                • 30 Posts
                Hi!
                I have some issues with listbox-multiple too.
                I declare it like this :
                {"field":"fruits","caption":"Fruit","inputTVtype":"listbox-multiple","inputOptionValues":"Apple||Peach||Strawberry"}


                When I use getImageList to display like this :
                [[!getImageList?	&tvname=`myMigxTV` &tpl=`@CODE:[[+fruits]]`]]


                If I selected for example Apple AND Peach, It displays like this "ApplePeach".
                I couldn't find a way so getImageList whould put a separator so I could process it with a snippet for example.

                I'm using Revo 2.3.1 and also tried with 2.3.2

                Am I missing something or is it a bug from migx not fully compatible with Revo 2.3.1/2.3.2 ?

                thanks!

                  • 47243
                  • 30 Posts
                  re,
                  I just tried it on revo 2.2.16 fresh install
                  have the same issue.
                  If I use a listbox-multiple and select multiple options
                  when I display them it will display all without any delimiters.
                    • 47243
                    • 30 Posts
                    re,
                    ok
                    I digged a little bit into the code of getImageList

                    If I comment line 240 which is
                    $value = $tv->renderOutput($docid);


                    then the delimiter is not stripped

                    but I don't really know what this line of code is used for.

                    So instead of modifying the code I just add
                    &processTVs=`0`


                    to the getImageList Snippet call like this :
                    [[!getImageList?    &tvname=`myMigxTV` &tpl=`@CODE:[[+fruits]]` &processTVs=`0`]]


                    and I have the pipeline delimiters ||

                    For now I will do this to solve my issue.
                    Can someone tell me when to set processTvs at 0 or at 1?


                    thanks
                      • 3749
                      • 24,544 Posts
                      The default for &processTVs is `1`. If you leave it out or set it to `1`, you'll get the processed value of the TV. @ bindings like @INHERIT will be processed and specialty TVs like image, Migx, and lists will be processed as well.

                      If you set it to `0`, you should get the 'raw' value of the TV -- what's in the database (though looking at the getImageList code, I don't see how). So for a TV set to @INHERIT, you'll get the string: '@INHERIT'.

                      If you can use the raw value of the TV, it's always faster.

                        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