Skip to content

Instantly share code, notes, and snippets.

View JonasEriksson's full-sized avatar

Jonas JonasEriksson

View GitHub Profile
@jsieber
jsieber / masonry.css
Last active August 29, 2015 13:57
Masonry Gallery for MuraCMS
.masonryItem {
width: 8.65%;
margin-bottom: 10px;
float: left;
}
.masonryItem.w2 {
width: 19.5%;
margin-bottom: 10px;
}
#masonryContainer {
@davejlong
davejlong / dsp_calendarJump.cfm
Created August 20, 2010 18:26
Mura CMSdisplay object to select a month and year to jump to on Calendar type pages
Gist has been moved into Mura plugin at http://github.com/davidlong03/more-dspobjects.
<cfif $.content('Type') EQ 'calendar'>
<cfsilent>
<cfscript>
if(structKeyExists(URL,'month'))cMonth = URL.month;
else cMonth = month(now());
if(structKeyExists(URL,'year'))cYear = URL.year;
else cYear = year(now());
</cfscript>
@stevewithington
stevewithington / dsp_custom_nav.cfm
Created October 10, 2012 17:41
Mura CMS: Simple Iterator Example
<!--- Uber simple Mura CMS Iterator --->
<cfscript>
feed=$.getBean("feed").loadBy(name="Local Index 'Name' Goes Here");
iterator=feed.getIterator();
</cfscript>
<cfif iterator.hasNext()>
<cfoutput>
@stevewithington
stevewithington / sql-if-else-case.sql
Created November 25, 2015 21:43
SQL: When you need a if / else / then in your WHERE clause, this might help ...
SET @someVar = 'someValue';
SELECT *
FROM t_sometable
WHERE CASE @someVar <> '' THEN someColumn = @someVar ELSE someColumn = '' END;
@stevewithington
stevewithington / muraAltTheme.cfm
Created August 19, 2014 16:21
Mura CMS : How to dynamically alter which theme Mura will use
<cfscript>
// drop this in your Site eventHandler.cfc
public any function onRenderStart(event, $) {
arguments.$.event('altTheme', 'MyTheme');
}
// this assumes you have a theme directory called 'MyTheme' of course
</cfscript>
<!--- This method would reload the application at the time it's executed --->
<cflocation url="./?#URLEncodedFormat(application.appreloadkey)#&reload=#URLEncodedFormat(application.appreloadkey)#" addtoken="false" />
<!--- OR --->
<!--- This method would force Mura to reload on the next event --->
<cfset application.appinitialized = false>
@jbuda
jbuda / gist:5428631
Last active December 16, 2015 11:38
Saving YouTube/Vimeo thumbnails into Mura
<!--- get a list of videos that need embeddeding --->
<cfparam name="range" default="1" />
<cfparam name="relativePath" default="/_SITEID_/assets/Image/video-thumbs/" />
<cfparam name="saveDirectory" default="#expandPath(relativePath)#" />
<cfparam name="siteID" default="_SITEID_" />
<cfscript>
// create the save directory if it doesn't exist
if (!directoryExists(saveDirectory))
@Reyjay
Reyjay / Mura_Code_Snippits.cfm
Created September 11, 2013 17:06
Code Snippits
Associated Image URL - #item.getImageURL()#
*****ATRIBUTE SET****
Add custom attribute set to iterator loop - #item.getValue('ContentTypes')#
<cfproperty name="contentHistID" type="string" default="" required="true" />
<cfscript>
// This determines what JavaScript library Mura should use with its built-in display objects. The options are Prototype and jQuery:
this.jslib='jquery';
// This allows you set start standard navigation behavior at lower navigation levels. For example, this would be useful if you have a section of your site that should have its own primary navigation:
this.navOffSet=0;
// This sets the maximum depth that standard navigation will follow:
this.navDepthLimit=1000;