Skip to content

Instantly share code, notes, and snippets.

@ronnieduke
ronnieduke / gist:d2500b871fcde5e48434
Last active August 29, 2015 14:25
Marketo Munchkin associateLead
<script>
mktoMunchkinFunction('associateLead',
{
Email: "someone@email.com",
FirstName: "John",
LastName: "Doe"
},
'{hashed key}'
);
</script>
<!--- Assuming you've created an extended attribute 'File' type called 'extAttributeImage' --->
<!--- In a Mura Page Template --->
#$.createHREFForImage(fileid=$.content('extAttributeImage'),size='myCustomSize')#
<!--- In a Mura Component --->
#$.createHREFForImage(fileid=$.component('extAttributeImage'),size='myCustomSize')#
<!--- From a site extended attribute --->
#$.createHREFForImage(fileid=$.siteConfig('extAttributeImage'),size='myCustomSize')#
@ronnieduke
ronnieduke / Code Snippets
Last active January 17, 2016 01:13
Mura Code Snippets
=============================
Content Image
=============================
<img src="#$.content().getImageURL(size='large')#" />
=============================
Extended Attribute Image
=============================
<!--- First, create an extended attribute with the type of 'File' --->
<img src="#$.createHREFForImage(filename=$.content('myExtAttribute'))#" />
loadEmbedShepherd(function(){
if(window.wistiaEmbeds===undefined){
return;
}
window.wistiaEmbeds.onFind(function(video) {
video.addPlugin("marketo", {
src: "js/MarketoWistiaPlugin.js",
outsideIframe: true
});
});
@ronnieduke
ronnieduke / eventHandler.cfc
Created February 20, 2015 18:42
Mura Force Page Layout
// Put this in your site or theme eventHandler.cfc
public any function onApplicationLoad($) {
// make sure 'News' page set to 'News.cfm' Page Template
var bean = $.content();
if ( bean.getValue('subType') == 'News' ) {
bean
.setValue('template', 'news.cfm')
.save();
@ronnieduke
ronnieduke / eventHandler.cfc
Created February 20, 2015 18:42
Mura Force Page Layout
// Put this in your site or theme eventHandler.cfc
@ronnieduke
ronnieduke / mura-node.cfm
Created January 19, 2015 23:43
Create a new Mura content node
<cfscript>
// Load a new content Bean
bean=$.getBean('content');
//Set the parent node of where you want the new node to live
bean.setParentID('some id');
bean.setTitle('Some Title');
//Should this go live immediately? 0=no 1=yes
@ronnieduke
ronnieduke / gist:07959a65ee2e1e0c4eb2
Created December 31, 2014 20:42
Omit Mura HTML Head Queues
<cfset $.getContentRenderer().renderHTMLQueues=false>
@ronnieduke
ronnieduke / gist:c2231cda3f56e660549f
Created December 22, 2014 18:40
Get Sub Nav from a Mura Page by Content ID
<cfset bean=$.getBean('content').loadBy(contentID="whatever content ID")>
<cfset subNav=bean.getKidsIterator()>
<cfif subNav.hasNext()>
<ul>
<cfloop condition="subNav.hasNext()">
<cfset item=subNav.next()>
<li><a href="#item.getURL()#">#item.getMenuTitle()#</a></li>
</cfloop>
</ul>
@ronnieduke
ronnieduke / eventHandler.cfc
Last active August 29, 2015 14:08
Render Mura Extended Attributes yourself. This is useful when wanting to use custom javascript or design to enhance the UX of your extended attributes.
<!--- Drop this into your site or theme eventHandler.cfc --->
<cffunction name="onContentTabBasicBottomRender">
<cfset subType = application.configBean.getClassExtensionManager().getSubTypeByName("Folder","Blog", $.event('siteID'))>
<cfset extendSets = subType.getExtendSets(inherit=true,container='Custom',activeOnly=true)>
<cfoutput>
<!--- Loop through the extend sets --->
<cfloop from="1" to="#arrayLen(extendSets)#" index="s">
<cfset extendSetBean=extendSets[s]/>