tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/14629-navigation-menu-top-level-folderCascade CMS: Discussion 2016-08-17T14:26:03Ztag:help-archives.hannonhill.com,2010-02-09:Comment/405513632016-08-16T19:09:19Z2016-08-16T19:09:19ZNavigation Menu Top Level Folder<div><p>Hi Aaron,</p>
<p>To confirm, do you just need to check if the folder is at the
root level? If so, you could just check it's <code>path</code> to
see if it contains a <code>/</code> or not. Top level folders would
not contain a slash, while nested folders would. A couple of ways
you could check:</p>
<pre>
<code>## no '/' is present at all:
$asset.path.indexOf("/") == -1
## size of "folder structure" is 1
$asset.path.split("/").size() == 1</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/405513632016-08-16T20:27:43Z2016-08-16T20:27:46ZNavigation Menu Top Level Folder<div><p>That did the trick! Thanks for your help!</p></div>Aaron Smithtag:help-archives.hannonhill.com,2010-02-09:Comment/405513632016-08-17T14:26:00Z2016-08-17T14:26:00ZNavigation Menu Top Level Folder<div><p>Not a problem at all, Aaron. I am glad to hear the proposed
snippets worked out.</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