tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/234-trying-to-pull-in-navigation-for-current-pages-siblingsCascade CMS: Discussion 2013-08-20T03:49:01Ztag:help-archives.hannonhill.com,2010-02-09:Comment/183498902012-08-29T16:02:44Z2012-08-29T16:02:44Ztrying to pull in navigation for current page's siblings<div><p>Hi roryreiff,</p>
<p>I suspect that the <code>$folder</code> variable may not be
returning what you are expecting, this is especially true if the
page you are viewing is at the root level because there is no
folder at that point. Keeping your Index Block the same, let's try
the following:</p>
<pre>
<code>#set ( $currentPage = $_XPathTool.selectSingleNode($contentRoot, "//system-page[@current]" ) )
#set ( $links = $_XPathTool.selectNodes($currentPage, "../system-page | ../system-symlink" ) )
<div class="pane pane-1 content-links">
<ul>
#foreach ($link in $links)
#if ( !$link.getAttribute("current") )
#set ( $path = $link.getChild('path').value )
#if ( $link.name == 'system-symlink' )
#set ( $path = $link.getChild('link').value )
#end
#set ( $displayName = $link.getChild('display-name').value )
<li><a href="$path">$displayName</a></li>
#end
#end
</ul>
</div></code>
</pre>
<p>What I am doing is obtaining the current page with
<code>//system-page[@current='true']</code> and selecting the
system-page and system-symlink assets at the same level as the
current page <code>../system-page | ../system-symlink</code>.</p>
<p>You should be able to remove the <strong>Append calling page
data</strong> option on the Index Block if you would like to reduce
the size of the Index Block a bit.</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/183498902012-08-29T18:53:03Z2012-08-29T18:53:03Ztrying to pull in navigation for current page's siblings<div><p>Thanks Ryan, it works beautifully! Appreciate the fast
response.</p></div>roryreifftag:help-archives.hannonhill.com,2010-02-09:Comment/183498902012-08-30T13:13:12Z2012-08-30T13:13:12Ztrying to pull in navigation for current page's siblings<div><p>THat's good news, glad to hear we got it working.</p>
<p>Have a good one!</p></div>Ryan Griffith