Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Created February 27, 2014 17:08
Show Gist options
  • Save stevewithington/9254460 to your computer and use it in GitHub Desktop.
Save stevewithington/9254460 to your computer and use it in GitHub Desktop.
Mura CMS : Example of how to get a list of Local Content Collections / Feeds to dynamically populate a select menu class extension.
<cfscript>
public any function getLocalFeeds() {
return variables.$.getBean('feedManager').getFeeds(siteid=variables.$.event('siteid'), type='local');
}
public any function getLocalFeedNames() {
var rs = getLocalFeeds();
return rs.getRecordcount()
? ValueList(rs.name, '^')
: 'No Content Collections Exist!';
}
</cfscript>
<attribute
name="feedList"
label="Listing Content Collection/Local Index Feed Name"
hint="Select the name of the Local Content Collection/Index to use"
type="selectbox"
defaultValue="[mura]ListFirst($.getLocalFeedNames(), '^')[/mura]"
required="false"
validation=""
regex=""
message=""
optionList="[mura]$.getLocalFeedNames()[/mura]"
optionLabelList="[mura]$.getLocalFeedNames()[/mura]" />
@alladinUK
Copy link

Hi Steve,
Thank you for your reply.

For some reason it was throwing the error I reported earlier even having done appreload. I've restarted Lucee and I am no longer getting an error and works as expected.

Thank you for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment