Created
November 29, 2012 18:13
-
-
Save stevewithington/4170872 to your computer and use it in GitHub Desktop.
Mura CMS: Category Iterator Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// Category Iterator of Children of the Current Content Node | |
itKidsCats = $.content().getKidsCategoryIterator(); | |
// Category Iterator of the CURRENT Content Node | |
itCats = $.content().getCategoriesIterator(); | |
</cfscript> | |
<cfoutput> | |
<!--- Children of the Current Content Node ---> | |
<h4>Kids Categories</h4> | |
<cfif itKidsCats.hasNext()> | |
<ul> | |
<cfloop condition="itKidsCats.hasNext()"> | |
<cfset kidItem = itKidsCats.next()> | |
<li>#HTMLEditFormat(kidItem.getName())#</li> | |
</cfloop> | |
</ul> | |
<cfelse> | |
<p><em>This content either has NO children, OR none of its children have been categorized.</em></p> | |
</cfif> | |
<!--- CURRENT Content Node ---> | |
<h4>Current Content Node's Categories</h4> | |
<cfif itCats.hasNext()> | |
<ul> | |
<cfloop condition="itCats.hasNext()"> | |
<cfset thisItem = itCats.next()> | |
<li>#HTMLEditFormat(thisItem.getName())#</li> | |
</cfloop> | |
</ul> | |
<cfelse> | |
<p><em>This content has NOT been categorized.</em></p> | |
</cfif> | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment