Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Mura method for getting a feed based on restrict groups
<cffunction name="getFeedByRestrictGroups" output="false">
<cfargument name="restrictGroups" required="true">
<cfargument name="maxItems" default="20">
<!--- Get the feed object by name --->
<cfset var feed = $.getBean("feed")>
<cfset var item = "">
<cfset feed
.setSortBy("OrderNo")
.setSortDirection("asc")
.setMaxItems(arguments.maxItems)>
<cfset feed.addParam(relationship='andOpenGrouping')>
<cfloop list="#arguments.restrictGroups#" index="item">
<cfset feed.addParam(
field='tcontent.RestrictGroups'
, relationship='OR'
, condition='CONTAINS'
, criteria=item
, dataType='VARCHAR'
)>
</cfloop>
<cfset feed.addParam(relationship='closeGrouping')>
<cfreturn feed>
</cffunction>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment