tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/256-optimizing-my-velocity-scriptsCascade CMS: Discussion 2013-08-20T03:41:35Ztag:help-archives.hannonhill.com,2010-02-09:Comment/190087752012-09-25T12:32:29Z2012-09-25T12:32:29Zoptimizing my velocity scripts<div><p>Hi,</p>
<p>Would you be able to provide the XML contents of your Index
Block as well for testing?</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/190087752012-09-25T13:27:00Z2012-09-25T17:56:13Zoptimizing my velocity scripts<div><p>Good Morning Ryan,</p>
<p>Thank you for your prompt response.</p>
<p>I have attached the index block as txt.</p></div>bchiutag:help-archives.hannonhill.com,2010-02-09:Comment/190087752012-09-25T16:00:12Z2012-09-25T16:00:12Zoptimizing my velocity scripts<div><p>Hi,</p>
<p>I hope you don't mind, but I re-tooled your Velocity a bit, see
attached. Here is a breakdown of what I did:</p>
<ul>
<li>Utilized common macros for displaying the repetitive content
(ie each category heading and container and each listing under the
category). This helps cut down on the length of the Format and
makes things a bit more manageable.</li>
<li>Because the Categories were hard-coded anyway, I used XPath to
query an existing variable for listings within each category,
rather than looping through and saving to multiple arrays and then
looping through each array. This helps cut down on the overall
complexity and also makes it a bit more manageable.</li>
</ul>
<p>Note: Because this uses macros, if you are on a version of
Cascade prior to 7.0.3 there may be issues with the <a href=
"https://hannonhill.jira.com/browse/CSI-413">macros caching</a>. So
if you update the macro and your updates don't seem to take, rename
the macro each time and that <em>should</em> clear the cached
macro.</p>
<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/190087752012-09-25T17:10:15Z2012-09-25T17:10:15Zoptimizing my velocity scripts<div><p>Thank you Ryan, I appreciate the help. We are running Cascade
7.0.3 (64-bit version).<br>
Dave<br>
________________________________________ From: Ryan Griffith
[<a href=
"mailto:tender+df1ff9f82e74a001c918dd7ad572ae67398c1415d@tenderapp.com">tender+df1ff9f82e74a001c918dd7ad572ae67398c1415d@tenderapp.com</a>]<br>
Sent: Tuesday, September 25, 2012 12:00 PM<br>
To: Moretti, David<br>
Subject: Re: optimizing my velocity scripts [Velocity Formats
<a href="/discussions/velocity-formats/256" title=
"Discussion #256">#256</a>]</p></div>dmorettitag:help-archives.hannonhill.com,2010-02-09:Comment/190087752012-09-25T17:50:14Z2012-09-25T17:50:14Zoptimizing my velocity scripts<div><p>Not a problem at all. You shouldn't have to worry about the
macro caching with your current version, so that's good news.</p>
<p>I'm going to go ahead and close this discussion, but feel free
to reply or comment to re-open this discussion if you have any
additional questions.</p>
<p>Thanks.</p></div>Ryan Griffith