Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Created August 26, 2014 22:29
Show Gist options
  • Save stevewithington/734c37f770cf33d72b75 to your computer and use it in GitHub Desktop.
Save stevewithington/734c37f770cf33d72b75 to your computer and use it in GitHub Desktop.
Mura CMS : Custom Kids Only Nav
<!---
Drop this into your theme's display_objects directory,
then include it on your template using $.dspThemeInclude('display_objects/nav_kids.cfm')
--->
<cfset itKids = $.content().getKidsIterator().setNextN(0) />
<cfoutput>
<ul class="navSecondary">
<li class="current">
<a class="current" href="#$.content('url')#">#$.content('menuTitle')#</a>
<cfif itKids.hasNext()>
<ul>
<cfloop condition="itKids.hasNext()">
<cfset item = itKids.next() />
<cfset itemclass = itKids.currentRow() eq 1
? 'first'
: itKids.currentRow() eq itKids.recordcount()
? 'last'
: '' />
<li class="#itemclass#">
<a href="#item.getValue('url')#">#item.getValue('menuTitle')#</a>
</li>
</cfloop>
</ul>
<cfelse>
<!--- No kids --->
</cfif>
</li>
</ul>
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment