Created
February 27, 2014 17:08
-
-
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.
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> | |
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> |
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
<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]" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.