Skip to content

Instantly share code, notes, and snippets.

View stevewithington's full-sized avatar
⛑️
solving problems

Steve Withington stevewithington

⛑️
solving problems
View GitHub Profile
@stevewithington
stevewithington / muraGetChildrenFeed.cfm
Last active December 2, 2020 17:18
Mura CMS : This example demonstrates how to obtain a content feed based on the contentid, type, and/or subtype.
<cfscript>
public any function getChildrenFeedByContentID(
required contentid
, string type=''
, string subtype=''
) {
var local = {};
local.feed = $.getBean('feed');
local.feed.setMaxItems(0);
@stevewithington
stevewithington / getLocalFeeds.cfm
Created February 27, 2014 17:08
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!';
@stevewithington
stevewithington / muraUserBeans.cfm
Created March 10, 2014 16:05
Mura CMS: These are examples of how to register an event handler/listener for when a user is being saved or updated, and then access the old user bean along with the new user bean.
<cfscript>
// Place these methods in your Site, Theme, or Plugin's eventHandler.cfc
public any function onBeforeUserSave($) {
var newUserBean = arguments.$.event('userBean');
var oldUserBean = arguments.$.getBean('user').loadBy(userid=arguments.$.event('userid'));
// if you want to stuff the oldUserBean in the event
// $.event('oldUserBean', oldUserBean);
@stevewithington
stevewithington / config.xml.cfm
Last active December 14, 2023 10:10
Mura CMS : Example of how to create a Frequently Asked Questions (FAQ) area/section with Mura CMS and Bootstrap3 markup.
<!--
1) Drop this in your theme /{SiteID}/includes/themes/{Theme}/config.xml.cfm
-->
<theme>
<extensions>
<extension type="Folder" subType="FAQ" availableSubTypes="Page/Question" iconClass="icon-question-sign">
</extension>
<extension type="Page" subType="Question" iconClass="icon-question" hasSummary="0" hasBody="0" hasAssocFile="0">
</extension>
@stevewithington
stevewithington / muraCleanFiles.cfm
Created March 31, 2014 16:53
Mura CMS : remove any truly orphaned files from Mura CMS.
<cfset application.serviceFactory.getBean('fileManager').cleanFileCache('[siteid]') />
@stevewithington
stevewithington / config.xml.cfm
Last active August 29, 2015 13:58
Proposed additional nodes to Mura's THEME config.xml.cfm ...
<theme>
<!-- Name of the theme -->
<name></name>
<!-- Version of the theme -->
<version></version>
<!-- Name of the creator/organization that developed the theme -->
<provider></provider>
@stevewithington
stevewithington / muraAnnounceEvent.cfm
Last active April 27, 2018 19:20
Mura CMS : Announce an Event From a Form
<!--- 1) Create a form with a hidden form field like shown below, and place it in a layout template, or in a display object, etc. --->
<form method="post">
<input type="text" name="myField" value="Some Value">
<input type="hidden" name="myFormIsSubmitted" value="true">
<input type="submit">
</form>
<cfscript>
// 2) In the eventHandler.cfc (Site, Theme, Plugin, or other custom handler) you could listen for the even in one of Mura's eventHandlers such as 'onRenderStart'
public any function onRenderStart(event, m){
@stevewithington
stevewithington / muraUserStrikesBean.cfm
Created May 7, 2014 15:19
Mura CMS : User Strikes Bean
<cfscript>
userStrikesBean = $.getBean('userstrikes').init(username=$.currentUser('username'), configbean=$.globalConfig());
WriteDump(var=userStrikesBean.getStrikes());
</cfscript>
@stevewithington
stevewithington / onAdminHTMLFootRender.cfm
Created May 19, 2014 19:48
Mura CMS : Override Mura's CSS settings in the Admin area.
<cfscript>
// this example shows how to override Mura's CSS settings in the Admin area ...
// you could also use jQuery or whatever other method as well.
// Add this method to a Mura CMS SITE, THEME or PLUGIN eventHandler.cfc
public any function onAdminHTMLFootRender($, event) {
var str = '';
savecontent variable='str' {
WriteOutput('
<style type="text/css">.mura select##restrictGroups { width:100% !important;}</style>
');
@stevewithington
stevewithington / muraSlideshowPager.css
Created May 21, 2014 16:05
Mura CMS : jQuery Cycle 2 Slideshow Pager CSS
/* base styling for Mura's jQuery Cycle 2 Slideshow Pagination */
ol.mura-pager {
margin: 0;
padding: 0;
position: relative;
z-index: 2;
}
ol.mura-pager li {
display: inline;