Forked from stevewithington/muraCategoryIteratorExamples.cfm
Created
September 12, 2018 23:18
-
-
Save jsieber/b7eb3ba17ed7269946fb8492423f09dc to your computer and use it in GitHub Desktop.
Mura CMS: Category Iterator Examples
This file contains hidden or 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