Skip to content

Instantly share code, notes, and snippets.

@ronnieduke
ronnieduke / mura-Extended-Attribute-File.cfm
Last active November 6, 2015 20:18 — forked from modmedia/mura-Extended-Attribute-File.cfm
Get URL for a Mura extended attribute file
<!--- In a Mura page template --->
#$.getURLForFile(fileid=$.content('extAttribute'))#
<!--- In a Mura component --->
#$.getURLForFile(fileid=$.component('extAttribute'))#
<!--- In a Mura iterator --->
#$.getURLForFile(fileid=item.getExtAttribute())#
@ronnieduke
ronnieduke / muraCustomUI.cfm
Created October 31, 2015 17:52 — forked from stevewithington/muraCustomUI.cfm
Mura CMS: Example of how to use the 'Custom UI' container/tab assignment option when creating a class extension.
<!---
A brief example on how to use the 'CustomUI' option when creating a class extension in Mura CMS.
This example assumes you have an extended attribute called 'Page/Book'.
It also assumes you have an attribute set using the 'CustomUI' container/tab assignment.
Any extended attributes you assign to the attribute set, you are responsible for collecting
that data using your own form fields. Make sure the 'name' and 'id' attributes match the
names you've used when you created the extended attributes! For example, if you have an
extended attribute with a name of 'bookPublisher', make sure you have a form field with an
'id' and 'name' attribute of 'bookPublisher'. Check your casing too!
@ronnieduke
ronnieduke / config.xml
Created October 26, 2015 17:31
Mura config.xml class extension
<extension type="" subType="">
<attributeset name="" container="Basic">
<attribute
name=""
label=""
hint=""
type="SelectBox"
defaultValue=""
required="false"
validation=""
@ronnieduke
ronnieduke / mura-iterator.cfm
Created October 26, 2015 17:29
Basic Mura Iterator
<cfset feed=$.getBean("feed").loadBy(name="Feed Name",siteID=$.event("siteid"))>
<cfset it=feed.getIterator()>
<cfif it.hasNext()>
<div>
<cfloop condition="it.hasNext()">
<cfset item=it.next()>
<p>looped content here</p>
</cfloop>
</div>
<script>
$('#tab-nav-2 > a').on('click',function(){
Munchkin.munchkinFunction('visitWebPage', {
url: window.location.href + '#tab-2'
});
})
$('#tab-nav-3 > a').on('click',function(){
Munchkin.munchkinFunction('visitWebPage', {
url: window.location.href + '#tab-3'
@ronnieduke
ronnieduke / code-1.cfm
Last active November 8, 2015 16:27 — forked from bennadel/code-1.cfm
UPDATE: Parsing CSV Data Files In ColdFusion With csvToArray()
<cffunction
name="csvToArray"
access="public"
returntype="array"
output="false"
hint="I take a CSV file or CSV data value and convert it to an array of arrays based on the given field delimiter. Line delimiter is assumed to be new line / carriage return related.">
<!--- Define arguments. --->
<cfargument
name="file"
@ronnieduke
ronnieduke / gist:a77da30f1e20fbaf84d1
Created July 16, 2015 17:19
Mura Categories Iterator
<cfoutput>
<cfset catList="">
<cfset it=$.content().getCategoriesIterator()>
<!--- Only run if there are categories applied to the page --->
<cfif it.hasNext()>
<!--- Loop through the categories and append them to the list --->
<cfloop condition="it.hasNext()">
<cfset cat=it.next()>
<!--- Append the current category to the list --->
@ronnieduke
ronnieduke / gist:8082fc4d9fa9e29b7060
Created July 15, 2015 21:23
Marketo Munchkin associateLead with company
<script>
mktoMunchkinFunction('associateLead',
{
Email: "[email protected]",
FirstName: "John",
LastName: "Doe",
Company: "Acme"
},
'{hashed key}'
);
@ronnieduke
ronnieduke / gist:47ca9a90432cac6f088b
Last active August 29, 2015 14:25
Marketo Munchkin associateLead PHP
<script>
mktoMunchkinFunction('associateLead',
{
Email: “<?php echo "decodeURIComponent(\"" . rawurlencode($_REQUEST["userEmail"]) . "\")" ?>”,
FirstName: "<?php echo "decodeURIComponent(\"" . rawurlencode($_REQUEST["userFirst"]) . "\")" ?>",
LastName: "<?php echo "decodeURIComponent(\"" . rawurlencode($_REQUEST["userLast"]) . "\")" ?>"
},
'<?php echo hash('sha1', 'mysecretkey' . $_REQUEST["userEmail"]); ?>'
);
</script>
@ronnieduke
ronnieduke / gist:f6e31445c17f6b15908c
Last active September 2, 2015 23:47
Marketo Munchkin associateLead CFML
<cfoutput>
<script>
mktoMunchkinFunction('associateLead',
{
Email: "#esapiEncode('javascript',url.userEmail)#",
FirstName: "#esapiEncode('javascript',url.userFirst)#",
LastName: "#esapiEncode('javascript',url.userLast)#"
},
'#hash('mysecretkey' & url.userEmail,'SHA-1')#'
);