Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Last active July 19, 2019 07:28
Show Gist options
  • Save stevewithington/5877694 to your computer and use it in GitHub Desktop.
Save stevewithington/5877694 to your computer and use it in GitHub Desktop.
Mura CMS : display a custom navigation based on a content collection/local index and include children up to a specific depth level.
<cfset feed = $.getBean('feed').loadBy(name='Your Feed Name')>
<cfset it = feed.getIterator()>
<cfif it.hasNext()>
<ul class="nav nav-list">
<li class="nav-header">Your Nav Header</li>
<cfloop condition="it.hasNext()">
<cfset item = it.next()>
<li<cfif $.content('contentid') eq item.getContentID()> class="active current"</cfif>>
<a href="#item.getURL()#">#HTMLEditFormat(item.getMenuTitle())#</a>
<!--- This is where you can specify how deep you want to go --->
#$.dspNestedNav(contentID=item.getContentID(), viewDepth=2)#
</li>
</cfloop>
</ul>
</cfif>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment