Skip to content

Instantly share code, notes, and snippets.

@ronnieduke
Created July 16, 2015 17:19
Show Gist options
  • Save ronnieduke/a77da30f1e20fbaf84d1 to your computer and use it in GitHub Desktop.
Save ronnieduke/a77da30f1e20fbaf84d1 to your computer and use it in GitHub Desktop.
Mura Categories Iterator
<cfoutput>
<cfset catList="">
<cfset it=$.content().getCategoriesIterator()>
<!--- Only run if there are categories applied to the page --->
<cfif it.hasNext()>
<!--- Loop through the categories and append them to the list --->
<cfloop condition="it.hasNext()">
<cfset cat=it.next()>
<!--- Append the current category to the list --->
<cfset catList=listAppend(catList,cat)>
</cfloop>
<!--- Output the final list --->
#catList#
</cfif>
</cfoutput>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment