Skip to content

Instantly share code, notes, and snippets.

@Dan4IT
Created May 1, 2015 08:00
Show Gist options
  • Save Dan4IT/d5fc170545acfc98dd26 to your computer and use it in GitHub Desktop.
Save Dan4IT/d5fc170545acfc98dd26 to your computer and use it in GitHub Desktop.
Mura Kids Iterator
<h2 class="page-header">What's On</h2>
<!--- Pull out a content iterator of the nodes child content.--->
<cfset it=$.getBean('content').loadBy(contentID='contentIDHere',siteID=event.getValue('siteID')).getKidsIterator()>
<!--- The number of Items to be listed is determined by the content.getNextN() value. It's default is 10. --->
<!---<cfset it.setPage(1)>--->
<cfset it.setNextN(5)>
<!--- You can also set the start row instead of setting a page number. --->
<!---<cfset it.setStartRow(1)>--->
<!---<cfloop from="1" to="#it.pageCount()#" index="p">
<cfset it.setPage(p)>--->
<!--- Iterate throught the child content.
The it.hasNext() will return true until the page length
as determined by the content.getNextN() has been reached --->
<cfloop condition="it.hasNext()">
<!--- The it.next() method returns a new contentNavBean. It acts as a facade to data into the wrapped query while digging into the full bean when needed. --->
<cfset sub1=it.next()>
<cfoutput>
<div class="row">
<div class="col-md-6">
<a href="#sub1.getURL()#"><img alt="#sub1.getMenuTitle()#" class="img-responsive" src="#sub1.getImageURL(size = 'whatson')#" /></a>
</div><!--- ./col-md-6 --->
<div class="col-md-6">
<a href="#sub1.getURL()#" style="color: ##436a1f;"><h3>#sub1.getMenuTitle()#</h3></a>
<p>#sub1.getSummary()#</p>
<p><a class="btn btn-primary" href="#sub1.getURL()#"><i class="glyphicon glyphicon-book">&nbsp;</i> Read More</a></p>
</div><!--- ./col-md-6 --->
</div><!--- ./row --->
<hr>
</cfoutput>
</cfloop>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment