Skip to content

Instantly share code, notes, and snippets.

@Dan4IT
Last active August 29, 2015 14:20
Show Gist options
  • Save Dan4IT/166073a80fc48e9d7b0f to your computer and use it in GitHub Desktop.
Save Dan4IT/166073a80fc48e9d7b0f to your computer and use it in GitHub Desktop.
Mura - AgentsIterator
<!--- Pull out a content iterator of the nodes child content.--->
<cfset it=$.getBean('content').loadBy(contentID='AgentsPageContentID',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(10)>
<!--- 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-12">
<h3><a href="#sub1.getURL()#">#sub1.getMenuTitle()#</a></h3>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="center-block">
<a href="#sub1.getURL()#"><img alt="#sub1.getMenuTitle()#" class="img-responsive img-rounded" src="#sub1.getImageURL(size = 'medium')#"></a>
</div>
</div>
<div class="col-md-8">
#sub1.getBody()#
</div>
</div>
</cfoutput>
</cfloop>
<p>[mura]#$.dspThemeInclude('templates/inc/agents_iterator.cfm')#[/mura]</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment