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 / muraTags.cfm
Last active January 3, 2016 22:19
Mura CMS : Example of how to obtain a recordset/query result of child content item's tags and their counts. As well as an example of how to filter a dynamic feed based on a specific tag.
<cfscript>
rsChildTags = $.getBean('contentGateway').getTagCloud(
siteid = $.event('siteid')
, parentid = $.content('contentid')
, categoryid = $.event('categoryid')
, taggroup = '' // could narrow down to a specific tag group as of 6.1
);
WriteDump(var=rsChildTags, label='rsChildTags');
@stevewithington
stevewithington / muraMailingListManager.cfm
Created January 20, 2014 20:49
Mura CMS : This is a custom Mailing List Manager example. You could create a custom display object and simply include it on a page somewhere on your site. This example requires the user to log in to sign up.
<cfsilent>
<cfscript>
mailingListName = 'Your Mailing List Name Goes Here';
// MailingListBean : Loading by Mailing List Name
mlBean = $.getBean('mailinglistBean').loadBy(
name=mailingListName
, siteid=$.siteConfig('siteid')
);
mlid = mlBean.getMLID();
@stevewithington
stevewithington / mura-scope.cfm
Last active December 14, 2023 10:11
Mura CMS : There will be times when you need to access the Mura Scope ($), but you're not in the context of a front end request. Here's an example of how you could do that, assuming your within the Application scope of Mura.
<cfscript>
// The Mura Scope : in order to access site-specific helpers (e.g., $.siteConfig()), we'll initialize it with a siteid.
$ = StructKeyExists(session, 'siteid')
? application.settingsManager.getBean('$').init(session.siteid)
: application.settingsManager.getBean('$').init('default');
// If you're not in the context of a Front-End Request, then there is NO ContentBean!
// So, we need to set it if we want to access it
// contentBean = $.getBean('content').loadBy(filename='home');
// $.setContentBean(contentBean);
@stevewithington
stevewithington / horizontalNav.htm
Last active February 12, 2018 10:09
Horizontal Nav With Horizontal Subnav Flyout Menu (and Vertical 3rd menu). Playground: http://cssdeck.com/labs/ggf1qhv6
<nav>
<ul>
<li>
<a href="#">item 1</a>
<ul>
<li>
<a href="#">item 1.1</a>
<ul>
<li><a href="#">item 1.1.1</a></li>
<li><a href="#">item 1.1.2</a></li>
@stevewithington
stevewithington / muraFeed.cfm
Created February 11, 2014 16:41
Mura CMS : Simple example of how to get extended attributes from a Mura Content Collection / Local Index / Feed.
<cfscript>
feed=$.getBean("feed").loadBy(name="Local Index/Content Collection 'Name' Goes Here");
iterator=feed.getIterator();
</cfscript>
<cfif feed.getIsNew()>
<p class="alert alert-info">The Feed/Content Collection does not exist.</p>
<cfelseif iterator.hasNext()>
<cfoutput>
<ul>
@stevewithington
stevewithington / config.js.cfm
Created February 12, 2014 16:32
Mura CMS : example of how to redefine only a portion of the CKEditor toolbar.
// this code goes in the file located under /{SiteID}/includes/themes/{ThemeName}/js/editor/config.js.cfm
config.toolbar_Default[9] = {name: 'group9', items:['Image','Flash','Media','gmap','-','Table','HorizontalRule','SpecialChar','PageBreak','-','Selectlink','SelectComponent','Templates'<cfif application.configBean.getEnableMuraTag()>,'muratag'</cfif>]};
@stevewithington
stevewithington / remoteFeedIterator.cfm
Last active November 27, 2017 14:38
Mura CMS : This example shows how to grab an external RSS feed, pull it into Mura, and create an Iterator.
<section>
<h2>Mura CMS</h2>
<cffeed query="rs" source="http://www.getmura.com/tasks/feed/?feedID=91B4E7A5-37AC-466A-ACDF6ABFD95ACCBD" />
<cfset it = $.getBean('beanIterator').setQuery(rs) />
<ul>
<cfif it.hasNext()>
<cfloop condition="it.hasNext()">
<cfset item = it.next()>
<li>
<a href="#item.getValue('rsslink')#">
@stevewithington
stevewithington / dsp_sharedLogin.cfm
Created February 14, 2014 16:24
Mura CMS: How to lock down a page/section with a single, shared password. 1) Create a User Group called "Shared User Group" 2) Create a User called "Shared User" and assign that user to the "Shared User Group" ... you could use something like "shareduser" for the username ... just be sure to note the password! 3) Lock down the content node you w…
<!--- drop this file under the theme's display_objects directory --->
<cfoutput>
<form id="login" class="form-horizontal" name="frmLogin" method="post" action="?nocache=1" onsubmit="return validate(this);" novalidate="novalidate" >
<legend>#arguments.$.rbKey('user.pleaselogin')#</legend>
<div class="control-group">
<label class="control-label required" for="txtPassword">#arguments.$.rbKey('user.password')#</label>
<div class="controls">
<input type="password" id="txtPassword" name="password" placeholder="#arguments.$.rbKey('user.password')#" required="true" message="#htmlEditFormat(arguments.$.rbKey('user.passwordrequired'))#" />
<span class="help-inline">#htmlEditFormat($.rbKey('user.required'))#</span>
</div>
@stevewithington
stevewithington / dspMuraComponent.cfm
Last active August 29, 2015 13:56
Mura CMS : If a Mura 'component' exists, then the object will be returned, otherwise an empty string will be returned.
<cfscript>
// drop this in your Theme or Site contentRenderer.cfc
public any function dspComponent(string componentid, siteid=variables.$.siteConfig('siteid')) {
var bean = IsValid('uuid', arguments.componentid
? variables.$.getBean('content').loadBy(contentid=arguments.componentid, siteid=arguments.siteid)
: variables.$.getBean('content').loadBy(title=arguments.componentid, type='Component', siteid=arguments.siteid);
return !bean.getIsNew()
? variables.$.dspObject(object='component', objectid=bean.getContentID(), siteid=arguments.siteid)
: '';
@stevewithington
stevewithington / muraDynamicExtendedAttributes.cfc
Last active April 16, 2017 22:15
Mura CMS : This is an example of how to dynamically populate an extended attribute select menu/selectbox based on a Mura Content Collection / Local Index.
<cfscript>
component extends="mura.cfobject" output="false" {
// Drop the methods below in your theme or site contentRenderer.cfc
// This example assumes you wish to populate the Label with the content Title, and the value stored would be the URL
// With the methods defined below, you should be able to add the following into your extended attribute fields:
// Option List: [mura]$.getSpeakersOptionList()[/mura]
// Option Label List: [mura]$.getSpeakersOptionLabelList()[/mura]