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

    I have a TV set up that allows the user to check a number of categories that a musician (in our case) belongs to.

    On the musician list page, I have a Ditto call that lists all the musicians on one page.
    What i want to do is have the categories assigned in the TV be added as classes to the div container in the list.

    This works fine if only one category is selected. I get:
    <div class="jazz"></div>


    But if several categories are selected, I get:
    <div class="jazzfunkorchestral"></div>


    So I need to find a way to be able to space the output of the TV to get:
    <div class="jazz funk orchestral"></div>


    Probably really simple, but I can’t get it to work.

    I’ve tried among other things:
    -Adding a space to the input values in the TV (orchestral ||funk || jazz )
    -Using a delimiter list widget in the TV (just leaving a space goes back to the comma default, so I get <div class="jazz,funk,orchestral"></div>


    Any help is greatly appreciated.
      • 16845
      • 26 Posts
      Thanks a lot for that advice.

      I’ll try those out in a bit and let you know.
        • 16845
        • 26 Posts
        Quote from: ganeshXL at Jun 18, 2008, 03:11 AM

        if($tv) {
        $render = str_replace(",", " ", $tv);
        return($render);
        }

        Thanks.  Looked at Phx (which I am using elsewhere) but couldn’t find any easy way of doing it.
        Used the str_replace snippet and it worked a treat.

        Changed str_replace(",", [glow=red,2,300]""[/glow], $tv); to str_replace(",", [glow=red,2,300]" "[/glow], $tv);
        Don’t know if it would have made any difference.

        Thanks a million.
          • 4385
          • 372 Posts
          I searched looking for an answer, did not find the one I wanted. smiley

          I needed this for a chunk and did not want the overhead of calling a snippet. I tricked the delimiter widget by using the ascii code for a space &#032;
            DropboxUploader -- Upload files to a Dropbox account.
            DIG -- Dynamic Image Generator
            gus -- Google URL Shortener
            makeQR -- Uses google chart api to make QR codes.
            MODxTweeter -- Update your twitter status on publish.