Skip to content

Instantly share code, notes, and snippets.

View JonasEriksson's full-sized avatar

Jonas JonasEriksson

View GitHub Profile
@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')#">
@modmedia
modmedia / muraDisplayExtendedAttributeImage.cfm
Created January 9, 2014 18:55
Method on displaying Mura extended attribute images, including custom image sizes
<!--- Assuming you've created an extended attribute 'File' type called 'extAttributeImage' --->
<!--- In a Mura Page Template --->
#$.createHREFForImage(filename=$.content('extAttributeImage'),size='myCustomSize')#
<!--- In a Mura Component --->
#$.createHREFForImage(filename=$.component('extAttributeImage'),size='myCustomSize')#
<!--- In the context of an iterator --->
#$.createHREFForImage(filename=item.getExtAttributeImage(),size='myCustomSize')#
@modmedia
modmedia / isotopeCSS.cfm
Last active January 2, 2016 15:19
Create an isotope gallery with Mura Categories as filters
<!--- if using CFStatic --->
<cf_CacheOMatic key="isotopeCSS">
#$.static()
.include('/css/isotope/')
.renderIncludes('css')#
</cf_CacheOMatic>
<!--- Static CSS Include --->
<!--- <link rel="stylesheet" href="#$.siteConfig('themeAssetPath')#/css/isotope/isotope.css"> --->
@stevewithington
stevewithington / parseMuraColor.cfm
Last active April 20, 2016 22:38
Mura CMS : Mura allows you to create an extended attribute to collect a color value via a color picker. The value is stored as: rgba(x,x,x,1). You can use a number of methods to extrapolate this value into other formats as needed. Keep in mind though, that most modern browsers allow for CSS3 color values (http://caniuse.com/css3-colors), so you …
<!--- drop these methods into your Site or Theme contentRenderer.cfm --->
<cfscript>
// props: http://cflib.org/udf/RGBtoHex
public any function RGBtoHex(r,g,b){
var hexColor = '';
var hexPart = '';
var i = 0;
for (i=1; i <= 3; i++){
hexPart = FormatBaseN(arguments[i],16);
/{SiteID}/includes/themes/MuraBootstrap/templates/inc/vertical_nav.cfm
@stevewithington
stevewithington / muraFormCustomObjectOptions.cfc
Last active November 20, 2020 15:13
Mura: Example of how to populate a Mura Form Builder select menu, radio group, or checkbox options with data from a SQL recordset via Custom Object option
component {
/**
* MURA FORM: `CUSTOM OBJECT` Options Example
*
* Notes:
* + On the form, select `Custom Object` and enter the dotted notation path to where this file resides under `/sites/{SiteID}`
* - For example, if the file is located under `/sites/default/remote/muraFormCustomObjectOptions.cfc`
* - Enter: `remote.muraFormCustomOptions`
* - Keep in mind, Mura will be looking for the `getData()` method! See below.
* + How to use a REMOTE SOURCE for options: <https://gist.github.com/stevewithington/115b5ac681fe35d42505b1cdedad1593>
@stevewithington
stevewithington / muraSourceImage.cfm
Created November 26, 2013 21:15
Mura CMS : If you're attempting to store "source" images in your Mura CMS, then you will want to modify your /config/settings.ini.cfm file. Then, you may also want to customize the default Gallery output and add a link to download the "Source" image.
<!--- Add this to your /config/settings.ini.cfm --->
maxsourceimagewidth=99999
<!---
As long as the source image width is less than the value (in pixels) entered above,
then the source image will NOT be modified at all
--->
<!---
Then, you will probably want to copy the '/display_objects/gallery/' directory,
<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;
@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" />