tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/12738-cant-get-value-to-showCascade CMS: Discussion 2015-10-22T13:25:16Ztag:help-archives.hannonhill.com,2010-02-09:Comment/382304422015-10-19T16:07:43Z2015-10-19T16:07:43Zcan't get value to show<div><p>Hi,</p>
<p>Are you able to confirm that <code>$footernav</code> has a Block
element assigned to it? If so, I want to note that a chooser
returns a <code>content</code> element for the selected asset, so
you will need to adjust your Format slightly:</p>
<pre>
<code>#set($footerlinks = $footernav.getChild("content").getChild("system-data-structure").getChild("footerlinks"))</code>
</pre>
<p>Note: If you are not seeing a <code>content</code> element, edit
your Data Definition and adjust the chooser's <strong>Render
Content Depth</strong> setting to 4 so the Index Block is able to
render the chosen Block's content.</p>
<p>Also, I wanted to note that if you simple need to get any
<code>footerlinks</code> element returned in the Index Block, you
could simplify things to:</p>
<pre>
<code>#set($footerlinks = $_XPathTool.selectNodes($contentRoot, "//footerlinks"))##
#if ($footerlinks.size() > 0)
#foreach($footerlink in $footerlinks)
<li><a href="#if($footerlink.getChild("link").getChild("path").value !="/")$_SerializerTool.serialize($footerlink.getChild('link').getChild('path'), true)#else$_SerializerTool.serialize($footerlink.getChild('external-link'), true)#end" #if($footerlink.getChild("newwin").value =="Yes")target="_blank"#end>$_SerializerTool.serialize($footerlink.getChild('link-text'), true).trim()</a></li>##
#end##
#end##</code>
</pre>
<p>If you need to filter to a specific Block containing the
<code>footerlinks</code>:</p>
<pre>
<code>#set($footerlinks = $_XPathTool.selectNodes($contentRoot, "//system-block/educationdegrees/_files[name='footer navigation']/footerlinks"))##
#if ($footerlinks.size() > 0)
#foreach($footerlink in $footerlinks)
<li><a href="#if($footerlink.getChild("link").getChild("path").value !="/")$_SerializerTool.serialize($footerlink.getChild('link').getChild('path'), true)#else$_SerializerTool.serialize($footerlink.getChild('external-link'), true)#end" #if($footerlink.getChild("newwin").value =="Yes")target="_blank"#end>$_SerializerTool.serialize($footerlink.getChild('link-text'), true).trim()</a></li>##
#end##
#end##</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/382304422015-10-21T20:26:41Z2015-10-21T20:26:41Zcan't get value to show<div><p>I was using the wrong index (i wasn't indexing blocks)... I
changed calling-page to current folder and siblings and used the
code below for my format and it worked great!</p>
<pre>
<code>#set($footernav = $_XPathTool.selectSingleNode($contentRoot, "//system-block[name='footer navigation']"))##
#set($footerlinks = $_XPathTool.selectNodes($footernav, 'system-data-structure/footerlink'))
#foreach($footerlink in $footerlinks)
<li><a href="#if($footerlink.getChild("link").getChild("path").value !="/")$_SerializerTool.serialize($footerlink.getChild('link').getChild('path'), true)#else$_SerializerTool.serialize($footerlink.getChild('external-link'), true)#end" #if($footerlink.getChild("newwin").value =="Yes")target="_blank"#end>$_SerializerTool.serialize($footerlink.getChild('link-text'), true).trim()</a></li>##
#end##</code>
</pre>
<p>thanks for the help!</p></div>Nandotag:help-archives.hannonhill.com,2010-02-09:Comment/382304422015-10-22T13:25:14Z2015-10-22T13:25:14Zcan't get value to show<div><p>Thank you for following up, I am glad to hear you were able to
get your Format working.</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