We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 17552
    • 46 Posts
    This is working:
    [[*longtitle:is=``:then=`[[<br />]]`:else=`<h1 style="margin-top:0.7em">[[*longtitle]]</h1>`]]


    This not (like in my first post):
    [[*longtitle:notempty=`<h1 style="margin-top:0.7em">[[*longtitle]]</h1>`]][[*longtitle:empty=`<br />`]]


    Can anyone confirm that the above code is working for him. Except BobRay???


    MODx tags are parsed whether they are in HTML comments or not.

    Yes. I know. That is what the error looks like. But it would be nice if there is a construct which allows me to comment something out without parsing or rendering to html...
    Something like this:
    [[# My Comment, bla bla]]

    Which gets totally removed by the parser, without processing or displaying...

    loxy


      • 22303 MODX Staff
      • 10,725 Posts
      The RegEx used by the output filters can not handle this syntax. It will have to be refactored to parse, likely without using RegEx (similar to the property parser) in order to handle a multitude of characters it uses in the current expression. Please enter an improvement ticket if one does not already exist.
        • 3749
        • 24,544 Posts
        You could certainly write a snippet that would return an HTML comment -- something like this:

        [[!Comment? &comment=`This is My Comment`]]


        <?php
        /* Comment Snippet */
        
        return "\n" . '<!-- ' . $comment . ' -->' . "\n" ;
          Did I help you? Buy me a beer
          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