Skip to content

Instantly share code, notes, and snippets.

@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()>
@stevewithington
stevewithington / muraAnnounceEvent.cfm
Last active April 27, 2018 19:20
Mura CMS : Announce an Event From a Form
<!--- 1) Create a form with a hidden form field like shown below, and place it in a layout template, or in a display object, etc. --->
<form method="post">
<input type="text" name="myField" value="Some Value">
<input type="hidden" name="myFormIsSubmitted" value="true">
<input type="submit">
</form>
<cfscript>
// 2) In the eventHandler.cfc (Site, Theme, Plugin, or other custom handler) you could listen for the even in one of Mura's eventHandlers such as 'onRenderStart'
public any function onRenderStart(event, m){