<![CDATA[ Support/Comments for ChunkReplace - MODX Community Forums]]> https://forums.modx.com/thread/?thread=38306 <![CDATA[Re: Support/Comments for ChunkReplace]]> https://forums.modx.com/thread/38306/support-comments-for-chunkreplace#dis-post-217076 Quote from: jamesehly at Dec 20, 2006, 07:15 AM

This is soooo sweet. I used this technique to do some basic SEO fixing on a site - change the str_replace with preg_replace like this:

$modx->documentOutput= preg_replace('#<span class="head">(.*)</span>#U', '<h1 class="head">$1</h1>', $modx->documentOutput); 


Works like a charm, and now I don’t have to go through hundreds of pages and change that content by hand.

One question - are the results of these end of page processing calls cached? Or does it process this every time?

Thanks!

James
This particular plugin works on the documentOutput after the documentContent is retrieved from either the database or a document cache file if it exists. So no, the results would not be cached, and would be executed only after all other dynamic elements were processed on the page.]]>
opengeek Dec 20, 2006, 09:18 AM https://forums.modx.com/thread/38306/support-comments-for-chunkreplace#dis-post-217076
<![CDATA[Re: Support/Comments for ChunkReplace]]> https://forums.modx.com/thread/38306/support-comments-for-chunkreplace#dis-post-217075
$modx->documentOutput= preg_replace('#<span class="head">(.*)</span>#U', '<h1 class="head">$1</h1>', $modx->documentOutput); 


Works like a charm, and now I don’t have to go through hundreds of pages and change that content by hand.

One question - are the results of these end of page processing calls cached? Or does it process this every time?

Thanks!

James]]>
jamesehly Dec 20, 2006, 01:15 AM https://forums.modx.com/thread/38306/support-comments-for-chunkreplace#dis-post-217075
<![CDATA[Support/Comments for ChunkReplace]]> https://forums.modx.com/thread/38306/support-comments-for-chunkreplace#dis-post-217074 ChunkReplace.

Use this forum to post any comments about this addition or any questions you have regarding its use.

Brief Description:
ChunkReplace is a very simple plugin that demonstrates how you can easily replace a specified string in your document output with the contents of a chunk at the end of page processing.]]>
opengeek Jul 20, 2006, 07:32 PM https://forums.modx.com/thread/38306/support-comments-for-chunkreplace#dis-post-217074