tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/424-showing-referenced-assets-in-a-navigationCascade CMS: Discussion 2012-01-12T19:58:24Ztag:help-archives.hannonhill.com,2010-02-09:Comment/72835072011-05-17T14:01:23Z2011-05-17T14:01:23ZShowing Referenced Assets in a Navigation<div><p>A referenced asset will appear in the XML just as a normal asset
would. The only distinction is an added attribute called
"reference" to that parent node.</p>
<p>In order for a referenced asset to be included in a navigation
you'll want to make sure that your Index Block includes that asset
type and that any XPath expressions in your Format don't filter
that item out.</p>
<p>(Screenshot attached of a referenced system-page in the
XML.)</p></div>Charlie Holdertag:help-archives.hannonhill.com,2010-02-09:Comment/72835072011-05-17T15:25:42Z2011-05-17T15:25:42ZShowing Referenced Assets in a Navigation<div><p>Charlie,</p>
<p>Attached are screenshots of the index block, the xslt format,
the folder within Cascade including the Reference Asset, and the
navigation as it appears on the site.</p>
<p>The index block and format are copied over from example.edu,
where the index shows two reference assets in its sidenav.</p>
<p>It works there. It doesn't work here.</p>
<p>What are we doing differently that would cause it to do so?</p></div>mrenfertag:help-archives.hannonhill.com,2010-02-09:Comment/72835072011-05-17T15:43:26Z2011-05-17T15:43:26ZShowing Referenced Assets in a Navigation<div><p>Would you mind attaching a .txt file of both your XSLT Format
and the entire XML block it is running on?</p>
<p>We can make the thread private if it contains sensitive
data.</p></div>Charlie Holdertag:help-archives.hannonhill.com,2010-02-09:Comment/72835072011-05-17T16:07:09Z2011-05-17T16:07:09ZShowing Referenced Assets in a Navigation<div><p>Not at all. No need to go private.</p>
<p>I've attached both the format and XML block code of our specific
problem (not the one above that uses example.edu's code).</p>
<p>We're trying to get the Referenced Asset "Local Accommodations"
to show as one of the children of the "Visit Us" page.</p>
<p>We appreciate any help on this matter.</p></div>mrenfertag:help-archives.hannonhill.com,2010-02-09:Comment/72835072011-05-17T17:22:05Z2011-05-17T17:22:05ZShowing Referenced Assets in a Navigation<div><p>I looked over this very briefly so this may not be the case, but
can you try playing around with this line in your XSLT:</p>
<pre>
<code> <xsl:for-each select="system-page[name != 'index'] | system-folder[dynamic-metadata[name='showInNav']/value = 'Yes'] | system-symlink"></code>
</pre>
<p>The part where it says <code>system-page[name != 'index']</code>
is probably causing the Format to ignore the Reference in the Index
Block (since the <code><name></code> of it is technically
<em>index</em>).</p>
<p>As a quick test, just try changing that entire line to:</p>
<pre>
<code> <xsl:for-each select="system-page[name = 'index'] | system-folder[dynamic-metadata[name='showInNav']/value = 'Yes'] | system-symlink"></code>
</pre>
<p>and see if it happens to appear in your navigation.</p></div>Timtag:help-archives.hannonhill.com,2010-02-09:Comment/72835072011-05-17T18:47:30Z2011-05-17T18:47:30ZShowing Referenced Assets in a Navigation<div><p>Tim,</p>
<p>Thanks for your help.</p>
<p>Taking out the exclamation point showed the Referenced Asset on
the menu, but also showed the index page, which we didn't want.
However, doing so made me realize that I had been referencing the
page and not the folder. Once I did reference the folder instead
and put back the exclamation point within the XSLT, we got only the
asset to be included on the menu.</p>
<p>In the future, how would we reference individual pages/files?
Would they need to live in their own folder?</p></div>mrenfertag:help-archives.hannonhill.com,2010-02-09:Comment/72835072011-05-17T19:47:42Z2011-05-17T19:47:42ZShowing Referenced Assets in a Navigation<div><p>No problem!</p>
<blockquote>
<p>In the future, how would we reference individual pages/files?
Would they need to live in their own folder?</p>
</blockquote>
<p>I'm not sure I totally understand the question. If you are
referring to how you would access references in your Index Block(s)
specifically, you would follow <a href=
"http://help.hannonhill.com/discussions/how-do-i/424-showing-referenced-assets-in-a-navigation#comment_7283730">
Charlie's recommendation above</a> regarding the use of the
<strong>reference</strong> attribute.</p>
<p>For example:</p>
<pre>
<code><xsl:apply-templates select="system-page[@reference='true']"/></code>
</pre></div>Tim