Mura method for getting a feed based on restrict groups
This file contains 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
<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