tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/205-block-insertionCascade CMS: Discussion 2018-10-18T20:36:05Ztag:help-archives.hannonhill.com,2010-02-09:Comment/33702702010-10-22T19:39:20Z2010-10-22T19:39:20ZBlock Insertion<div><p>As long as you can get the block content and the page's content into an index block you could so something like the following Velocity format:<br />
</p>
<pre><code>#set( $data = $_XPathTool.selectSingleNode($contentRoot, "/system-index-block/calling-page/system-page/system-data-structure") )
#set( $content = $_SerializerTool.serialize($data.getChild("content"), true) )
#set( $replacementContent = $_SerializerTool.serialize($data.getChild("replacementContent"), true) )
$content.replaceAll("replace with contact info", $replacementContent)</code></pre>
<p>For my example, I just had two WYSIWYGs on a page and searched the one for the phrase "replace with contact info". I then replace that phrase with the content from my other WYSIWYG. You will need to update the XPath to the content regions to where ever they are within your index block. This example will also rely on the user entering the correct phrase where the information is suppose to be pulled in. You can update the replace statement with whatever you decide, bearing in mind that the Velocity Format is actually looking for a regular expression. So if you decide to use special characters, they may need to be escaped.</p>
<p>I am not completely sure if this is the best way but it was the only way I could come up with.</p></div>Pennytag:help-archives.hannonhill.com,2010-02-09:Comment/33702702010-10-22T21:28:50Z2010-10-22T21:28:50ZBlock Insertion<div><p>Thanks Penny. I will look into trying this. Have a great weekend.<br />
</p>
<p>Kris</p></div>Kris