Skip to content

Instantly share code, notes, and snippets.

@mattlevine
Forked from stevewithington/muraTopLevelNav.cfm
Created April 27, 2018 19:14
Show Gist options
  • Select an option

  • Save mattlevine/3411479fafaa4d2c95ff451bbcfe5dbc to your computer and use it in GitHub Desktop.

Select an option

Save mattlevine/3411479fafaa4d2c95ff451bbcfe5dbc to your computer and use it in GitHub Desktop.
Mura CMS : Example of how to output the top level nav items (excluding home)
<!---
You could always just use dspPrimaryNav(), but here's an easy way to output the top level nav items,
and have complete control over the rendered output.
--->
<cfoutput>
<cfscript>
it = $.getBean('content').loadBy(filename='').getKidsIterator();
</cfscript>
<cfif it.HasNext()>
<nav>
<ul>
<cfloop condition="it.hasNext()">
<cfset item = it.next() />
<li>
<a href="#item.getURL()#">
#HTMLEditFormat(item.getMenuTitle())#
</a>
</li>
</cfloop>
</ul>
</nav>
</cfif>
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment