Skip to content

Instantly share code, notes, and snippets.

View jsieber's full-sized avatar

John Sieber jsieber

  • BlueLine Development
  • Missoula, Montana
View GitHub Profile
@lxcodes
lxcodes / content_iterator.cfm
Last active December 18, 2015 08:59
Mura CMS Basic CFScript Content Iterator from Local Content Index
<cfscript>
// Grab local content index (feed) by name. I believe siteid is optional, but I have always included it.
var feed = application.feedManager.readByName('Banners', $.event("siteid"));
// Create a content iterator from the feed.
var banners = feed.getIterator();
// HTML to add to.
var html = "";
@stevewithington
stevewithington / dspCustomNavWithChildren.cfm
Last active July 19, 2019 07:28
Mura CMS : display a custom navigation based on a content collection/local index and include children up to a specific depth level.
<cfset feed = $.getBean('feed').loadBy(name='Your Feed Name')>
<cfset it = feed.getIterator()>
<cfif it.hasNext()>
<ul class="nav nav-list">
<li class="nav-header">Your Nav Header</li>
<cfloop condition="it.hasNext()">
<cfset item = it.next()>
<li<cfif $.content('contentid') eq item.getContentID()> class="active current"</cfif>>
<a href="#item.getURL()#">#HTMLEditFormat(item.getMenuTitle())#</a>
<!--- This is where you can specify how deep you want to go --->
@justincarroll
justincarroll / bootstrap-masonry-template.htm
Last active August 15, 2020 16:48
This is my template for using Masonry 3 with Bootstrap 3. For those of you who follow this gist a lot has changed since Bootstrap 2.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Masonry Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700">
@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
@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,
@stevewithington
stevewithington / muraCustomGallery.cfm
Last active December 30, 2015 01:09
Mura CMS : This is an example of creating a custom Gallery in Mura CMS.
<!---
1) Create a directory called 'gallery' under either:
a) /{SiteID}/includes/display_objects/custom/gallery/
OR
b) /{SiteID}/includes/themes/{ThemeName}/display_objects/gallery/
2) Add an index.cfm file to the above directory, and then place this code in it.
--->
<cfscript>
$.loadShadowboxJS();
@stevewithington
stevewithington / muraFindAndReplace.cfm
Last active April 25, 2019 04:08
Mura CMS : Find old links in Mura CMS and replace/update them with new ones, quickly and easily with this little script.
<cfscript>
// place this in your Site or Theme eventHandler.cfc, then reload your application!
public any function onApplicationLoad($) {
arguments.$.getBean('contentUtility').findAndReplace(
find='http://olddomain.com'
, replace='http://newdomain.com'
, siteid=arguments.$.event('siteid')
);
}
</cfscript>
/assets/
/cache/
.LCK
.lck
.settings
.project
settings.xml
.rds*
.svn
_mm*
@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')#
@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>