Subscribe: RSS
  • Sometimes I want to put comments in my templates and chunks, but I don’t want to use html comments because I don’t want them in the final source code. It would be cool if there was a comment tag in Revo... maybe the syntax could be [[#comment]]?
    <body>
    [[#to customize the header, save your custom div structure in a chunk and pass the chunk name as the value of &customHeaderChunk]] 
    [[$header? &dept=`[[getDept]]` &customHeaderChunk=`blueBox`]]
    ...
    


    I’m thinking these would just appear in the element they belong to when you are viewing/editing that element. When a resource rendered, the parser would just eat them and they’d disappear. No nesting, no processing anything inside them... just keep it simple.

    Anyone else think this would be useful?
    • [quote author=jrotering link=topic=49368.msg288158#msg288158 date=1273866140]
      [[to customize the header, save your custom div structure in a chunk and pass the chunk name as the value of &customHeaderChunk]] 
      


      This will work now. When MODx doesn’t find the snippet, it will eat the tag (at the cost of a little processing time). smiley

      I do like your idea since it would be faster if MODx knew to just eat tags with a certain token.
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/MODx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
      • Quote from: jrotering at May 14, 2010, 07:42 PM
        [[to customize the header, save your custom div structure in a chunk and pass the chunk name as the value of &customHeaderChunk]] 
        


        This will work now. When MODx doesn’t find the snippet, it will eat the tag (at the cost of a little processing time). smiley

        I do like your idea since it would be faster if MODx knew to just eat tags with a certain token.
          Get my Book: MODX:The Official Guide
          MODX info for everyone: http://bobsguides.com/MODx.html
          My MODX Extras
          Bob's Guides is now hosted at A2 MODX Hosting
        • Funny, I didn’t think of that! But yeah, if it were made formal and wouldn’t tax processing time, that would be even better.
          • two thumbs up, way up. great suggestion but maybe a way to let some pass through if necessary.

            [[# This comment should never show up in html and is the default style of comment]]
            [[#comment? &displayInHtml=`false`: This comment should also NOT show up in html!]]

            [[#comment? &displayInHtml=`true`: This comment should show up in the rendered html]]


            or some easier and less ’comment’ intrusive convention, but still allow them to pass through if needed....

            ....I sometimes mark templates with comments for customers.

            • I’m not sure I’ve fully understood the issue....anyway, to comment portions of code in tpl I use the straight Php comment tag {* this is commented out *} and it works with no problem.

              • I was looking for making comments in Chunck too.
                For now I use the [[ ]] trick, but I agree a official comment tag would be great!
                • Quote from: basw at Dec 19, 2010, 09:21 AM

                  I was looking for making comments in Chunck too.
                  For now I use the [[ ]] trick, but I agree a official comment tag would be great!

                  Great trick! Thanx
                  • Funnily enough, I was just thinking this morning about how useful this feature would be, wondering if anybody had suggested it yet - and here it is at the top of the wishlist forum. +1 for an official tag & thanks for the temporary solution! I’m not too stingy with processing time.... smiley
                      Jason
                    • Erm, I would think the processing time for removing all code within the proposed comment tags would be nearly equal to the processing time for ignoring tags of a non-existent element. Maybe not, but that’s my guess.

                      That said, has this been filed at http://bugs.modx.com/ ? Features never filed never make it into releases. wink
                        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com