tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/14410-foreach-block-is-bleeding-into-the-next-blockCascade CMS: Discussion 2016-07-13T19:21:46Ztag:help-archives.hannonhill.com,2010-02-09:Comment/403154832016-07-13T13:04:34Z2016-07-13T13:04:34Zforeach block is bleeding into the next block...<div><p>Hi Nando,</p>
<p>I noticed when you set your <code>$blockpath</code> and
<code>$blocksite</code> variables, you are using <code>$data</code>
as the context and not <code>$block</code> from the
<code>#foreach</code>:</p>
<pre>
<code>#set ($blockpath = $data.getChild("content-block").getChild("path").value)
#set ($blocksite = $data.getChild("content-block").getChild("site").value)</code>
</pre>
<p>This would explain why you are only seeing the one result
instead of the individual blocks. Instead, I think you want:</p>
<pre>
<code>#set ($blockpath = $block.getChild("path").value)
#set ($blocksite = $block.getChild("site").value)</code>
</pre>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/403154832016-07-13T13:13:47Z2016-07-13T13:13:47Zforeach block is bleeding into the next block...<div><p>wow, duh! thanks</p></div>Nandotag:help-archives.hannonhill.com,2010-02-09:Comment/403154832016-07-13T19:21:45Z2016-07-13T19:21:45Zforeach block is bleeding into the next block...<div><p>Not a problem at all, Nando. Glad to hear the proposed change
helped out.</p>
<p>I'm going to go ahead and close this discussion, please feel
free to comment or reply to re-open if you have any additional
questions.</p>
<p>Have a great day!</p></div>Ryan Griffith