Skip to content

Instantly share code, notes, and snippets.

View JonasEriksson's full-sized avatar

Jonas JonasEriksson

View GitHub Profile
@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>
@JamieMason
JamieMason / html-languages.txt
Created September 19, 2012 08:50
HTML lang attribute / ISO language code reference / Culture names
CULTURE SPEC.CULTURE ENGLISH NAME
--------------------------------------------------------------
Invariant Language (Invariant Country)
af af-ZA Afrikaans
af-ZA af-ZA Afrikaans (South Africa)
ar ar-SA Arabic
ar-AE ar-AE Arabic (U.A.E.)
ar-BH ar-BH Arabic (Bahrain)
ar-DZ ar-DZ Arabic (Algeria)
ar-EG ar-EG Arabic (Egypt)
@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 / muraCategoryIteratorExamples.cfm
Created November 29, 2012 18:13
Mura CMS: Category Iterator Examples
<cfscript>
// Category Iterator of Children of the Current Content Node
itKidsCats = $.content().getKidsCategoryIterator();
// Category Iterator of the CURRENT Content Node
itCats = $.content().getCategoriesIterator();
</cfscript>
<cfoutput>
<!--- Children of the Current Content Node --->
<h4>Kids Categories</h4>
<cfif itKidsCats.hasNext()>
@stevewithington
stevewithington / muraImportContentFromRSS.cfm
Last active January 15, 2024 14:29
Mura CMS: Example of how to import content into Mura CMS from an RSS feed. Place the file under your Mura root. For example: http://yourdomain.com/temp/import/index.cfm. Also see https://gist.github.com/stevewithington/5051646 to importUsersViaCSV
<cfscript>
param name='form.rssurl' default='http://www.npr.org/rss/rss.php?id=1014';
param name='form.parentfilename' default='blog';
param name='form.isSubmitted' default='false';
param name='form.istest' default='true';
param name='form.siteid' default='default';
$ = application.serviceFactory.getBean('$').init(form.siteid);
if ( !$.currentUser().isSuperUser() && !$.currentUser().isInGroup('admin') ) {
@stevewithington
stevewithington / muraImportUsersViaCSV.cfm
Last active January 19, 2024 09:02
Example of how to import Users into Mura CMS via .CSV file. Also see https://gist.github.com/stevewithington/4742829 to import content from an RSS Feed.
<cfscript>
param name='form.csvUrl' default='#getPageContext().getRequest().getScheme()#://#cgi.server_name##getDirectoryFromPath(getPageContext().getRequest().getRequestURI())#users.csv';
param name='form.group' default='Temp';
param name='form.isSubmitted' default='false';
param name='form.isTest' default='true';
param name='form.siteid' default='default';
$ = application.serviceFactory.getBean('$').init(form.siteid);
if ( !$.currentUser().isSuperUser() && !$.currentUser().isInGroup('admin') ) {
<!--- 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))
@stevewithington
stevewithington / muraImage.cfm
Last active April 28, 2020 15:26
Mura CMS : Meta Image / Primary Associated Image Output
<!---
This is one way to generate a custom meta image based on the content item's primary associated image.
You could use this method in several other ways as well, such as inside a content iterator, etc.
If the fileid passed into this method is not a valid image, then it will return an empty string
--->
<cfif Len($.getURLForImage($.content('fileid')))>
<cfscript>
img = $.getURLForImage(
fileid = $.content('fileid') // could be _any_ fileid in Mura
,size = 'custom' // small, medium, large, custom, or any other pre-defined image size
@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" />