Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save davidpanzarella/9276986 to your computer and use it in GitHub Desktop.
Save davidpanzarella/9276986 to your computer and use it in GitHub Desktop.
<cfscript>
public any function getChildrenFeedByContentID(
required contentid
, string type=''
, string subtype=''
) {
var local = {};
local.feed = $.getBean('feed');
local.feed.setMaxItems(0);
local.contentBean = $.getBean('content').loadBy(contentid=arguments.contentid);
if ( !local.contentBean.getIsNew() ) {
local.feed.addParam(
relationship='AND'
,field='tcontent.path'
,dataType='varchar'
,criteria=local.contentBean.getContentID()
,condition='CONTAINS'
);
}
if ( Len(arguments.type) ) {
local.feed.addParam(
relationship='AND'
,field='tcontent.type'
,dataType='varchar'
,criteria=arguments.type
);
}
if ( Len(arguments.subtype) ) {
local.feed.addParam(
relationship='AND'
,field='tcontent.subType'
,dataType='varchar'
,criteria=arguments.subtype
);
}
return local.feed;
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment