Last active
January 3, 2016 21:49
-
-
Save stevewithington/8524689 to your computer and use it in GitHub Desktop.
Mura CMS : Example of how to create a user feed bean and loop over the user iterator to output data and extended attributes.
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> | |
// USER feed bean | |
userFeed = $.getBean('userFeed'); | |
// if user(s) belong to a different site, specify desired siteid | |
// userFeed.setSiteID('someSiteID'); | |
// if you know the groupid, you can filter that | |
// userFeed.setGroupID('someGroupID', false); | |
// filter only users of a specific subType | |
// userFeed.addParam( | |
// relationship='AND' | |
// , field='tusers.subtype' | |
// , condition='EQUALS' | |
// , criteria='Physician' | |
// , dataType='varchar' | |
// ); | |
// the iterator! | |
userIterator = userFeed.getIterator(); | |
</cfscript> | |
<cfoutput> | |
<cfif userIterator.hasNext()> | |
<ul> | |
<cfloop condition="userIterator.hasNext()"> | |
<cfset user = userIterator.next() /> | |
<li> | |
#HTMLEditFormat(user.getValue('lname'))#, #HTMLEditFormat(user.getValue('fname'))#<br /> | |
#HTMLEditFormat(user.getValue('someExtendedAttributeNameGoesHere'))# | |
<!--- <cfdump var="#user.getAllValues()#" /> ---> | |
</li> | |
</cfloop> | |
</ul> | |
<cfelse> | |
<div class="alert alert-info alert-dismissable"> | |
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button> | |
<strong>Yo!</strong> No users match the filter criteria. | |
</div> | |
</cfif> | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment