We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27680
    • 23 Posts
    I have a template variable which can be set to more than one value.

    e.g. the TV is used to store details of the types of food in offer in different restaurants, and it can be set to one or more of ’Chinese’, ’Thai’, ’Malaysian’, ’Japanese’ and ’Korean’.

    My problem is this:

    If more than one value is selected, when the values are output to the page - using [*tv-name*] - there is no space or seperarator between the different values. It looks something like this:

    Food Types: ChineseThaiKorean

    What can I do to format this output so that I can display multiple values properly? (How can I seperate values with commas, or such like?)

    Thanks in advance for your help.

    Smaavie


      • 22303 MODX Staff
      • 10,725 Posts
      Use the delimited list formatting widget to apply any kind of delimiter between the values when they are prepared for display.
        • 27680
        • 23 Posts
        Thanks - that was exactly what I was looking for.

        Others may be interested to know that to get the list to work exactly as I wanted I had to set the seperator to be
        , 


        i.e. the seperator is a comma AND a space.

        This way, there was a space after each comma when the list was output.


        Thanks again for your help.

        Smaavie
          • 33273
          • 60 Posts
          I’ve got a problem with this delimiter (, ).
          All displays fine but when I want to use tag filter (with Ditto 1.1)

          [!Ditto? &startID=`57` &language=`russian` ....bla-bla-bla..... &depth=`1` &tagDelimiter=`, ` &tagData=`tvname_of` &tagMode=`onlyTags` &tags=`Korean`!]

          it finds the only documents that have ’Korean’ at the first position of tv output. ( Korean, Chinese, Thai, ... )
          And ignore documents with output Chinese, Korean, Thai ..
          I. e. Ditto "breaks" on the first delimiter , 
          I also tried to set &tagDelimiter to `, ` and `,%26nbsp;` with no success...

          I can’t save the delimiter `, ` in Resource Manager... it always cut the space symbol....

          sorry for my English. laugh