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

    how can I comment out some e.g. a snippet call inside a template? So far i can only make it invisible to the user by using the html-comment tags (<!-- and -->). But the snippet still gets executed and is viewable in the page source.

    I know, I simply could delete the lines in question, but I prefer to let them, where they are...maybe I could use them later.

    I have tried to search for this, but the search finds only blog-related topics. sad

    Greetings,
    CoreBit

      • 18397
      • 3,250 Posts
      You could add a space between the brackets ie [ [ or [ ! . You should only need to do this on one of the two brackets to stop it from being parsed.
        • 5798
        • 22 Posts
        That way you can see the original line of code in the html source of the page, which is even worse!

        Is there no modx-tag for commenting out chunks of code by the parser? Something like "[comment] [/comment]" like in ITL (Interchange Tag Language)...?

        Greetings,
        CoreBit
          • 25663 MODX Staff
          • 12,272 Posts
          No there is not currently.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me