Skip to content

Instantly share code, notes, and snippets.

@ronnieduke
ronnieduke / form-builder-include
Created October 27, 2014 23:25
Mura Form Builder States List
Add this as the "custom object" source of your dropdown in form builder:
[m]$.siteConfig('themeAssetPath')[/m]/display_objects/states-list.cfm
@ronnieduke
ronnieduke / placeholder.js
Last active July 11, 2017 15:11
jQuery Toggle Placeholder
// Placeholder Toggle jQuery Extension
$.fn.togglePlaceholder = function() {
return this.each(function() {
$(this)
.data("holder", $(this).attr("placeholder"))
.focusin(function(){
$(this).attr('placeholder','');
})
.focusout(function(){
$(this).attr('placeholder',$(this).data('holder'));
@ronnieduke
ronnieduke / geo.cfm
Created October 6, 2014 22:48
Free service for geo location
<cfif NOT StructKeyExists(cookie, "mylat") AND NOT StructKeyExists(cookie, "mylon")>
<cfparam name="country" default="US">
<cfparam name="results" default="">
<cftry>
<cfhttp url="http://freegeoip.net/xml/#cgi.remote_addr#" name="results" method="get" delimiter="#chr(10)#" timeout="10" />
<cfset colname = results.columnlist> <!--- there's only one column and its name isn't something we can reference it by --->
@ronnieduke
ronnieduke / fullCalendar.less
Last active August 29, 2015 14:07
Starter LESS code for Mura Full Calendar
//Full Calendar
.MuraCalendar{
// The Calendar header stuff
.fc-header{
.fc-button{
// Hover class added via js
&.fc-state-hover{
background-color: @primary;
background-image: none;
color: @white;
<cfscript>
feed=$.getBean('feed');
feed.setContentID($.getBean('content').loadBy(filename=$.content().getFilename() &'/slides').getContentID());
// pull items even if nav = 0
feed.setShowNavOnly(0);
// pull items even if display = 0
feed.setLiveOnly(0);
it=feed.getIterator();
</cfscript>
@ronnieduke
ronnieduke / config.xml.cfm
Last active August 29, 2015 14:05
Get Mura Site's Custom Image Sizes to use in a component or any other extended attribute
<theme>
<imagesizes>
<imagesize name="carouselimage" width="939" height="479" />
</imagesizes>
<extensions>
<extension type="Component" subType="Slider" hasBody="0">
<attributeset name="Slider Options" container="Basic">
<attribute
@ronnieduke
ronnieduke / mura-bulk-update.cfm
Last active August 29, 2015 14:03
Create bulk updates in Mura such as setting items to display, or show in nav
<!---
Place this file in your theme remote folder
--->
<cfscript>
// add the content ID of the folder you wish to loop through and turn on
itemID=''
content=$.getBean('content').loadBy(contentID=itemID);
// Only get the feed if it's a valid node
@ronnieduke
ronnieduke / mura-custom-query-iterator.cfm
Created June 24, 2014 16:41
Use the Mura Iterator with a custom query
<cfquery name="rsExample">
SELECT content,siteID
FROM tcontent
WHERE .....
</cfquery>
<cfset it=application.serviceFactory.getBean("contentIterator")>
<cfset it.setQuery(rsExample)/>
<!--- Now Iterate and pull attributes that aren't in the query --->
<cfloop condition="it.hasNext()">
<cfset item=it.next()>
@ronnieduke
ronnieduke / mura-category-feed.cfm
Created June 13, 2014 22:24
Mura Category Feed
<cfset catBean = $.getBean('category').loadBy(name="Portfolio Item")>
<cfset catFeed = catBean.getKidsQuery()>
<cfset catList = ValueList(catFeed.name)>
<cfloop list="#catList#" index="category">
<li><a href="##" data-filter=".#$.createCSSID(category)#">#category#</a></li>
</cfloop>
@ronnieduke
ronnieduke / muraCleanFiles.cfm
Created May 28, 2014 20:46 — forked from stevewithington/muraCleanFiles.cfm
Clean orphaned files in Mura
<cfset application.serviceFactory.getBean('fileManager').cleanFileCache('[siteid]') />