tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/9734-trying-to-get-images-and-links-to-show-wont-renderCascade CMS: Discussion 2014-04-29T16:15:26Ztag:help-archives.hannonhill.com,2010-02-09:Comment/325776592014-04-16T11:46:24Z2014-04-16T11:46:24ZTrying to get images and links to show... won't render<div><p>Hi,</p>
<p>I have a few questions to see if we can narrow things down a
bit:</p>
<ul>
<li>What output are you seeing currently?</li>
<li>Do you have a <a href=
"http://help.hannonhill.com/kb/technical-primer/cascade-server-technical-primer#dynamic-content-blocks-">
calling page Index Block</a> applied to the region this Format is
applied to?</li>
</ul>
<p>When you have a moment, also provide the sample XML generated
using the Preview Options when editing the Format. Specifically,
we'll want to include your page as context so the XML contains the
<strong>gridpopup</strong> nodes.</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/325776592014-04-16T14:19:36Z2014-04-16T14:19:36ZTrying to get images and links to show... won't render<div><p>I do have a calling page. Attached is what it renders out.</p>
<p>Here is the generated XML:</p>
<pre>
<code>
<root><system-data-structure><header-image><content/><path>/_assets/images/prospective-header.png</path><link>site://GradDiv/_assets/images/prospective-header.png</link><site>GradDiv</site><name>prospective-header.png</name><display-name>prospective-header.png</display-name><summary>The UC Irvine Graduate Division mission is to serve as a catalyst for a world-class graduate educational experience, to foster oversight and communication of institutional academic policies, and to provide resources and essential services to promote the diversity and success of the next generation of leaders.</summary></header-image><quote-top>Something catchy here fdsafdsafdsa</quote-top><content>fdasfdsafdsafdasfdsafdsafdasfdsafdsafdasfdsafdsafdasfdsafdsafdasfdsafdsa</content><gridpopup><griditem><griditemlink><content/><path>/news-and-events/alumni-spotlights/caganberker </path><dynamic-metadata><name>in-side-menu</name><value>Yes</value></dynamic-metadata><link>site://GradDiv/news-and-events/alumni-spotlights/caganberker </link><site>GradDiv</site><name>caganberker </name><display-name>Cagan Berker </display-name><title>Engineering Alumnus Cagan Berker’s Poster Wins First Place</title><summary>Engineering Alumnus Cagan Berker’s Poster Wins First Place </summary><start-date>Dec 11, 2013 4:00 PM</start-date></griditemlink><gridimage><content/><path>/_assets/images/someguy.jpg</path><link>site://GradDiv/_assets/images/someguy.jpg</link><site>GradDiv</site><name>someguy.jpg</name></gridimage><griditemname>An image of a person</griditemname></griditem></gridpopup><resources><resource><header/><copy/></resource></resources></system-data-structure></root></code>
</pre>
<p>And here is the xml preview of the base asset:</p>
<pre>
<code>
<root><system-data-structure><header-image><path>/</path></header-image><quote-top>Something catchy here</quote-top><content/><gridpopup><griditem><griditemlink><path>/</path></griditemlink><gridimage><path>/</path></gridimage><griditemname>An image of a person</griditemname></griditem></gridpopup><resources><resource><header/><copy/></resource></resources></system-data-structure></root></code>
</pre></div>msyed1984tag:help-archives.hannonhill.com,2010-02-09:Comment/325776592014-04-17T13:57:23Z2014-04-17T13:57:23ZTrying to get images and links to show... won't render<div><p>Hi,</p>
<p>It looks like you are close, but for the
<strong>gridimage</strong> and <strong>griditemlink</strong>
elements you are attempting to convert an element to a value.
Instead, you want to grab the value of the <strong>link</strong>
element.</p>
<p>When you have a moment, try the following and let me know how it
works out for you:</p>
<pre>
<code>#set ($griditems= $_XPathTool.selectNodes($contentRoot, '//gridpopup/griditem'))
#foreach ($gitem in $griditems)
#if ($gitem)
#set ($gimage = $gitem.getChild("gridimage").getChild("link").value)
#set ($glink = $gitem.getChild("griditemlink").getChild("link").value)
#set ($gname = $gitem.getChild("griditemname").value)
<div class="grid-item">
<a class="imglink" href="$glink"><img src="$gimage" alt="$gname"/></a>
</div>
#else
<p>&nbsp;</p>
#end
#end</code>
</pre>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffith