We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5282
    • 147 Posts
    hi ! i have a little problem with equal signs in snippets
    for example, this very simple snippet:

    [[test]]
    
    return $var;
    
    




    if i use [!test? &var=something=test!]

    the snippet will only return "something", it will stop right before the equal signs

    what do i have to do to "protect" the equal signs huh
    thanks ( i’m a php noob )

    my config

    modx 0.9.1
    php 4.4.1 ( full details about my php config http://60gp.ovh.net/test.php )
    mysql 4.0.17
    ( it’s a unix server )
      i’m not a native english speaker, sorry if there are any mistakes ! smiley

      Pikkitux.com Website about Ubuntu Linux, Website Creation, and many other how-tos, tips and tricks ... ( French Language, and of course Modx Powered ! )
      • 25663 MODX Staff
      • 12,272 Posts
      Place the variables inside backtics (`) and see if that helps. On english keyboards, that’s the key to the left of the top-row 1.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 5282
        • 147 Posts
        i just tried with
        [!test? &var=`something=test`!]
        the problem is still there ...,
        by the way do u have the same problem ?

        ( i use modx in french, with the utf-8 charset, maybe it’s language/font related ? )
        edit : i also tried in ISO-8851 and in english, this bug is not language, charset encoding related ...

        thanks for your help
          i’m not a native english speaker, sorry if there are any mistakes ! smiley

          Pikkitux.com Website about Ubuntu Linux, Website Creation, and many other how-tos, tips and tricks ... ( French Language, and of course Modx Powered ! )
          • 31337
          • 258 Posts
          I think the current parser translates any ’=’ as a literal and uses that for assignment. Can you enter a bug/enchancement request please to allow the escaping of it and to be used as a literal character?

          As a work around, maybe you can write your snippet like this:
          [!test? &var=something**test!]

          And then in your snippet code, replace the ’**’(or whatever chars you want to use) with ’=’
            • 5282
            • 147 Posts
            i will enter a bug request,

            about the ** ==> = replacement ,i’m a php newbie, i just started readings some docs a few days ago, and i don’t know much about regex yet ..., maybe you would know how to do that ? )
            thx
              i’m not a native english speaker, sorry if there are any mistakes ! smiley

              Pikkitux.com Website about Ubuntu Linux, Website Creation, and many other how-tos, tips and tricks ... ( French Language, and of course Modx Powered ! )
              • 33337
              • 3,975 Posts
              Hi chunky,

              Please use http://modxcms.com/bugs/ to log this and all future Bugs/Feature requests.

              thanks,

              zi
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
                • 31337
                • 258 Posts
                Quote from: chucky at Dec 24, 2005, 11:27 AM

                i will enter a bug request,

                about the ** ==> = replacement ,i’m a php newbie, i just started readings some docs a few days ago, and i don’t know much about regex yet ..., maybe you would know how to do that ? )
                thx

                Let me answer that with a question smiley

                Why do you need a literal ’=’ passed into the snippet? Can you give me an example (don’t need the actualy code, just an explanation).
                  • 5282
                  • 147 Posts
                  well i just made a snippet
                  http://modxcms.com/forums/index.php/topic,1941.0.html

                  which generates round boxes, example here http://wiki.jalakai.co.uk/dokuwiki/doku.php/test/boxes

                  i use a variable for the content of the box, with just pure text it works fine, but i’d like to use html code for the box content.

                  thanks

                  bye

                  >zi, sorry i thought the bug section of the forum was the place to report bugs
                    i’m not a native english speaker, sorry if there are any mistakes ! smiley

                    Pikkitux.com Website about Ubuntu Linux, Website Creation, and many other how-tos, tips and tricks ... ( French Language, and of course Modx Powered ! )
                    • 31337
                    • 258 Posts
                    Now I am confused. The snippet takes key/value pairs normally (as it should). I don’t understand why you need to pass a literal ’=’ into the snippet. Can you explain please?

                    BTW, I agree that it’s a bug that an escaped ’=’ can’t be passed in, not arguing that point. Just don’t see what you’re trying to accomplish with the syntax of:
                    [!test? &var=something=test!]

                    That’ll call the test snippet, and set ’var’ to ’something’. Are you expecting it to set ’var’ to ’something=test’?
                      • 32241
                      • 1,495 Posts
                      Hi vbrillon,

                      From what I understand, chucky wanting to pass html tag as the text into the snippet as well, which in html tag, there will be a text with equal sign on it, take an example from this example.

                      [!test? &var=`<a href="index.htm"`!]
                      


                      Hope that clarifies things up.

                      Chucky, my suggestion for now, you can get into the snippet code, and change the php calling that parse the variables to fetch it from chunk. I’m not to for usre whether this will be a better solution for you or not. The other way is you can use TV and call up the TV value from the snippet, and this will help you if you need to use the snippet in every pages and every pages will have different value assign into the box.

                      If you need s suggestion, feel free to post it in here, and explain it further of what you’re trying to do. Hope all of the people in here able to help you with that.

                      Merry Christmas...

                        Wendy Novianto
                        [font=Verdana]PT DJAMOER Technology Media
                        [font=Verdana]Xituz Media