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

    I wonder how I can use comments in my templates, which are not shown in the resulting frontend HTML code. I tried
    <!-- my comment here -->

    That’s an ordinary HTML comment, and it’s shown in the frontend - I don’t want that. In PHP, I normaly use
    <?php /* my comment */ ?>
    But you can’t use PHP in a template.

    How do you comment your templates?

      • 26931
      • 2,314 Posts
      and it’s shown in the frontend
      on the actual site or in the source code? using
      <!-- my comment here -->
      works for me btw.
        • 30107
        • 44 Posts
        Quote from: sharkbait at Jan 21, 2010, 04:17 AM

        and it’s shown in the frontend
        on the actual site or in the source code? using
        <!-- my comment here -->
        works for me btw.
        Oh, I should have written it more precisely;
        <!-- my comment here -->
        works, it’s shown in the source of the frontend website. But I don’t want it to be shown in the source of the frontend site. I just want to be able to comment my code in the backend templates.
          • 26931
          • 2,314 Posts
          guess you could easily write a plugin to remove the comments on system event "OnWebPagePrerender"
            • 36416
            • 589 Posts
            Quote from: titanium at Jan 21, 2010, 04:07 AM

            How do you comment your templates?

            [[TODO:this comment is non-existing snippet, so MODx parser will ignore it...]]
              • 30107
              • 44 Posts
              These are great ideas! Thanks a lot! smiley