-
-
Save stevewithington/9254460 to your computer and use it in GitHub Desktop.
<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]" /> |
Hi,
Where are you supposed to put getLocalFeeds.cfm?
I'm trying to do the same, I've created extended attributes under site/Default class extensions do the dropdown can appear under "Site settibngs"
As I'm not sure where to put getLocalFeeds.cfm, I added the methods under contentRenderer.cfm
Unfortunately when I try to edit my site settings, I get an error in the console getLocalFeedNames is unidentified in Mura scope.
I don't think I should be adding it to contentRenderer.cfm, but I'm not sure where else to add it.
Hope you can point me in the right direction.
Thank you.
@alladinUK, you should be able to put the methods in either the site or theme contentRenderer.cfc
. Depending on which one you place the methods in, you may have to reload Mura in order for them to get picked up. If that doesn't work, let me know the full path to the file you're trying to place them in.
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.
Steve,
I am not sure if this is expected or something that needs some attention in the core (6.2.6389). However, this code did not work for me with Oracle. It appears the value of type is "Local", so with a case sensitive DB using your code as "local" returns nothing.
For this code (getLocalFeeds()) to work on a case sensitive DB it needs to be:
variables.$.getBean('feedManager').getFeeds(siteid=variables.$.event('siteid'), type='Local');
Thanks for the great GISTs BTW!