We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9995
    • 1,613 Posts
    I have a TV called [*docTags*] which I want to use for class="[*docTags*]".
    Because its sometimes , seperated so my classname gets like:

    <div class="website, logo" style="display:none;">Something</div>

    CSS
    .website {display:block!important;}

    The .website, character in CSS doesn't work as classname.
    So I need to remove or change the ,

    Anyone knows if thats possible with js or PHx ?

    Something like:
    [*phx:if=`[*docTags*]`:has=`,`:then:changeinto=`-`*]

    or

    <script>
    id .tagsholder find , and change into -
    </script>

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

    [ed. note: fourroses666 last edited this post 13 years, 7 months ago.]
      Evolution user, I like the back-end speed and simplicity smiley
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      If you don't need this comma-delimited list anywhere else, you could use the TV's output widget to set the delimiter.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 9995
        • 1,613 Posts
        I also have an overviewpage with the doctags.

        Maybe with some: phx modifier or preg replace script?
        I'm still searching lipsrsealed

          Evolution user, I like the back-end speed and simplicity smiley
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          stripString -- Strips string of specified value [[+name:stripString=`Mr.`]]
          replace -- Replaces one value with another [[+pagetitle:replace=`Mr.==Mrs.`]]

          http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+%28Output+Modifiers%29
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 9995
            • 1,613 Posts
            Hmm, I use EVO (and ditto):

            Works: [+docTags+]

            Does not: [+docTags:stripString=`,`+]
            Does not: [+docTags:replace=`,==-`+]

            Blank output, any idea's ?

            I also tested with the pagetitle:
            [*pagetitle:replace=`test==ALALALA`*]
            [+pagetitle:replace=`test==ALALALA`+]
            


            All blank and pagetitle = test [ed. note: fourroses666 last edited this post 13 years, 7 months ago.]
              Evolution user, I like the back-end speed and simplicity smiley
            • discuss.answer
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Ah. Well, you could always make your own http://wiki.modxcms.com/index.php/PHx#Custom_modifiers - name it phx:replace.

              <?php
              $newvalue = str_replace(',',' ',$output);
              return $newvalue;


              See the existing custom modifiers for more examples. http://wiki.modxcms.com/index.php/PHx/CustomModifiers
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 9995
                • 1,613 Posts
                I got it:
                [+docTags:replace+]

                Thx Susan [ed. note: fourroses666 last edited this post 13 years, 7 months ago.]
                  Evolution user, I like the back-end speed and simplicity smiley