tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/12147-hide-menus-with-velocityCascade CMS: Discussion 2015-08-10T15:25:35Ztag:help-archives.hannonhill.com,2010-02-09:Comment/373577672015-08-07T14:56:38Z2015-08-07T14:56:38ZHide menus with velocity <div><p>Hi,</p>
<p>I was going over some older discussions and noticed this one is
still open. Were you able to work through your issue with
displaying the navigations within your Velocity Format?</p>
<p>If not, I think your main issue is the top level
<code>#foreach</code>. Specifically, since you are merely looking
for the top level folder that contains the current page, you should
be able to combine everything into one single loop.</p>
<p>We actually have an <a href="https://github.com/hannonhill/Velocity-Cookbook/blob/master/Left-Navigation/leftnav-ul.vm">
example of this</a> within our Velocity samples project on Github.
I believe you should be able to refactor this slightly to add in
your dynamic metadata checks (most likely <a href="https://github.com/hannonhill/Velocity-Cookbook/blob/master/Left-Navigation/leftnav-ul.vm#L58-L59">
here</a>) and change the setting of the <code>$items</code>
variable at the bottom to something like:</p>
<pre>
<code>#set($items = $_XPathTool.selectNodes($contentRoot, "/system-index-block/system-folder[descendant::system-page[@current]]"))</code>
</pre>
<p>Please feel free to let us know if you have any other
questions.</p>
<p>Thanks.</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/373577672015-08-10T14:40:35Z2015-08-10T14:40:35ZHide menus with velocity <div><p>Hello Ryan,<br>
Thank you I was able to fix the issue, it was related to the
foreach at the very top level. However the a weird issue just
emerged, when trying to create new pages within subfolder about 5
levels down, the main nav just disappears. Would you know why? Its
seems odd, since the main nav has nothing to do with the sublevel
pages I am creating, I have retraced my steps to look on the
template level, content type, format and configuration set and all
seems normal. Cant pinpoint as to why this behavior.</p>
<p>Thanks</p></div>pipequenotag:help-archives.hannonhill.com,2010-02-09:Comment/373577672015-08-10T14:43:28Z2015-08-10T14:43:28ZHide menus with velocity <div><p>Hi there,</p>
<p>Ryan is out of the office at the moment so I'd like to gather
some additional information from you. When you have a moment, can
you please click Edit on the Index Block in question, then take a
screen shot (showing the Edit screen) and attach it here?</p>
<p>Thanks</p></div>Timtag:help-archives.hannonhill.com,2010-02-09:Comment/373577672015-08-10T14:52:59Z2015-08-10T14:52:59ZHide menus with velocity <div><p>Hello Tim,<br>
Ok, so I was trying a few things and I think it fixed it. I am
attaching the screen shot requested.. so I upped the index level
number from 4 to 6 and that made the main nav display on pages that
were 5-6 levels deep form root.<br>
However, I am a bit confused. I thought the settings on the
index-block referred only to the levels that you want the format to
print. Could you explain a bit more on this?<br>
thanks.</p></div>pipequenotag:help-archives.hannonhill.com,2010-02-09:Comment/373577672015-08-10T15:06:50Z2015-08-10T15:06:50ZHide menus with velocity <div><p>Thanks for attaching that screen shot. The field you changed is
the one that I was going to take a look at based on your
description of the problem.</p>
<blockquote>
<p>However, I am a bit confused. I thought the settings on the
index-block referred only to the levels that you want the format to
print. Could you explain a bit more on this?</p>
</blockquote>
<p>In order for your Format to generate the navigation that you
need, it has to have the directory/asset structure available to it.
When your Index Block was limited to going 4 levels deep, once you
got to that 5th level, your Format was likely looking for
information that wasn't there (because indexing stopped 1 level
above your current location in the directory tree).</p>
<p>Let me know if that helps to clarify at all.</p>
<p>Thanks</p></div>Timtag:help-archives.hannonhill.com,2010-02-09:Comment/373577672015-08-10T15:22:05Z2015-08-10T15:22:05ZHide menus with velocity <div><p>Yes it does. Thank you so much Tim!<br>
I have an another discussion open regarding breadcrumbs and
index-blocks, would you mind taking a quick look at it?, <a href="http://help.hannonhill.com/discussions/velocity-formats/12323-breadcrumbs-base-folder-page">
http://help.hannonhill.com/discussions/velocity-formats/12323-bread...</a></p>
<p>thank you</p></div>pipequenotag:help-archives.hannonhill.com,2010-02-09:Comment/373577672015-08-10T15:25:33Z2015-08-10T15:25:33ZHide menus with velocity <div><p>Perfect. Glad I could help out. I'll go ahead and close out this
discussion.</p>
<p>Someone from our team will post on your other discussion as soon
as we're able to.</p>
<p>Thanks!</p></div>Tim