OK, I found it -- you only need one plugin. I had to rewrite it a little for MODX 2.x to remove deprecated variables, make it work multiple times on the page, switch the event to one that worked in 2.0, and add <pre></pre> tags to the output. Rahul definitely did the critical work on this one, though, and deserves the credit for it.
Tags cut and pasted from your page will work fine, you can use it multiple times on the same page, and other MODx tags on the page outside the <fixedpre><fixedpre> tags will be parsed as usual.
Create a plugin called FixedPre.
Paste in the code below.
On the System Events tag, check the box next to OnParseDocument.
Save the plugin.
Put the tags you don’t want to execute inside <fixedpre></fixedpre> tags.
<?php
/** plugin fixedpre -- implements <fixedpre> tag
* MODx code inside <fixedpre></fixedpre> tags will be displayed
* rather than executed.
* @author Rahul Dhesi
* @author Bob Ray
* @package fixedpre
* Support: // http://rahul.rahul.net/modx-hints/fixedpre-tag.html
*
*/
if (! function_exists('quote_meta') ) {
function quote_meta($a) {
$lhs = array("<", ">", "[", "]", "!", "{", "}", "`");
$rhs = array("<", ">", "[", "]", "!", "{", "}", "`");
$b = str_replace("&", "\255", $a[2]); //save "&"
$lhs_preg = array('|<!(!*)fixedpre>|', '|<!(!*)/fixedpre>|');
$rhs_preg = array('<$1fixedpre>', '<$1/fixedpre>');
$b = preg_replace($lhs_preg, $rhs_preg, $b);
$b = str_replace($lhs, $rhs, $b);
return '<pre>' . str_replace("\255", "&", $b) . '</pre>'; // restore "&" add <pre> tags
}
}
$output =& $modx->resource->_output;
$output = preg_replace_callback("#(<fixedpre>)(.*?)(</fixedpre>)#s",
"quote_meta", $output);
[update] The Forum software inserts #38; before each token. These have to be removed for the plugin to work. The easiest way is to quote this message in a reply and paste the code from there.