echo '<!-- Comment From a Snippet -->';
[(#COM this condition is use for .....)] [+phx:if=`[*parent*]`:is=`8`:then=`[[Ditto?&documents=`12`&tpl=`aff_lien`&depth=`1`]]`+]
[[DOC: This is some helpful stuff right here. Enjoy! ]]
Hi
I think, you’re searching this:
http://modxcms.com/extras/package/76
Greetz
JUSI
/**
* Plugin: commentTags
* Author: Garry Nutting
* Version: 1.1
* For: MODx 0.9.5+
*
* Attach to: OnParseDocument, OnWebPagePrerender
*/
// set the tag nomenclature
$commentOpenTag = '[comment]';
$commentCloseTag = '[/comment]';
// escape special regex characters
$commentOpenTag = preg_quote($commentOpenTag,'/');
$commentCloseTag = preg_quote($commentCloseTag,'/');
// remove comments
$output = &$modx->documentOutput;
$e = &$modx->Event;
switch ($e->name) {
case 'OnParseDocument':
case 'OnWebPagePrerender':
$output = preg_replace('/('.$commentOpenTag.'.*?'.$commentCloseTag.')/ims','',$output);
break;
default:
return;
break;
}
Description
Adds the ability to comment out portions of the site content by using comment/comment tags. Surround the content you want to comment with the tags and the content will be removed from the final output of the MODx generated page.
The plugin is designed to run before snippet, chunks, and template variables are parsed - removing any unnecessary processing that may otherwise be carried out. Then, the plugin is run again right before content is sent to the browser to remove any comment tags that may have been included as part of the parsing process.
Instructions
To install:
1. Copy the contents of the text file.
2. Paste into a new plugin in the MODx Manager (Resources -> Plugins tab -> Create new plugin)
3. Tick the OnParseDocument and OnWebPagePrerender events for the plugin.
4. Save the plugin.
Code commenting is now activated. The tags used for commenting can be customised in the plugin code to whatever you want them to be.