tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/10251-build-path-dynamicallyCascade CMS: Discussion 2018-10-18T20:37:16Ztag:help-archives.hannonhill.com,2010-02-09:Comment/338165072014-07-18T15:02:50Z2014-07-18T15:02:50ZBuild path dynamically<div><p>Hi Lauren,</p>
<p>It sounds like there may be an issue with one, or both, of your
variables. When you have a moment, please attach or paste your
Format so I can take a closer look.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/338165072014-07-18T16:05:34Z2014-07-18T16:05:34ZBuild path dynamically<div><p>Here is the format. And the xml</p></div>lauren.frasertag:help-archives.hannonhill.com,2010-02-09:Comment/338165072014-07-18T17:39:29Z2014-07-18T17:39:29ZBuild path dynamically<div><p>Thank you for attaching the Format and XML, Lauren.</p>
<p>Looking over the Format, I am seeing that you are setting these
variables as follows:</p>
<pre>
<code>#set ( $docsFirstName = $docInfo.getChild("firstName") )
#set ( $docsLastName = $docInfo.getChild("lastName") )</code>
</pre>
<p>This is setting the variables to an XML Element and not a value,
so when you attempt to output them within the
<code><img></code> tag, it's actually going to output
something like the following:</p>
<pre>
<code>[Element:
<firstName />]</code>
</pre>
<p>So, instead of:</p>
<pre>
<code> <img src="[system-asset]_common/images/providers/${docsFirstName}-${docsLastName}.png[/system-asset]" /></code>
</pre>
<p>Try the following:</p>
<pre>
<code> <img src="[system-asset]_common/images/providers/${_EscapeTool.xml($docsFirstName.value)}-${_EscapeTool.xml($docsLastName.value)}.png[/system-asset]" /></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/338165072014-07-28T18:20:22Z2014-07-28T18:20:22ZBuild path dynamically<div><p>Ryan, that worked perfectly. Thanks!</p></div>lauren.fraser