This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section> | |
<h2>Mura CMS</h2> | |
<cffeed query="rs" source="http://www.getmura.com/tasks/feed/?feedID=91B4E7A5-37AC-466A-ACDF6ABFD95ACCBD" /> | |
<cfset it = $.getBean('beanIterator').setQuery(rs) /> | |
<ul> | |
<cfif it.hasNext()> | |
<cfloop condition="it.hasNext()"> | |
<cfset item = it.next()> | |
<li> | |
<a href="#item.getValue('rsslink')#"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// Save this file to a path such as /{SiteID}/includes/remote/ajaxData.cfm | |
// This allows you to pass in the siteid and contentid via URL params | |
param name='url.siteid' default='default'; | |
param name='url.contentid' default='00000000000000000000000000000000001'; | |
// Mura $cope | |
$ = application.serviceFactory.getBean('$').init(url.siteid); | |
// Just in case we need access to the ContentBean | |
cBean = $.getBean('content').loadBy(contentid=url.contentid); | |
$.setContentBean(cBean); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// Drop this in your Site or Theme eventHandler.cfc | |
public any function onBeforeFormSubmitSave($) { | |
// reference to the formBean | |
var formBean = arguments.$.event('formBean'); | |
// example on how to create some errors | |
var error = ''; | |
var errors = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// drop this in your eventHandler.cfc | |
public any function yourMethod() { | |
// you do something here | |
} | |
public any function onApplicationLoad($) { | |
arguments.$.getBean('someBean').injectMethod('someMethod', yourMethod); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component extends='mura.cfobject' { | |
// drop this in your site or theme eventHandler.cfc | |
public any function onRenderStart($) { | |
// allow for a 'View As PDF' link (e.g., <a href="./?viewAsPDF=1">View As PDF</a>) | |
if ( IsBoolean(arguments.$.event('viewAsPDF')) && arguments.$.event('viewAsPDF') ) { | |
arguments.$.content('template', 'pdf.cfm'); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- Drop this into your site eventhandler.cfc ---> | |
<cffunction name="onAfterFormSubmitSave" output="true"> | |
<cfif $.event('formid') EQ '{ID of the Mura form}'> | |
<!--- Get the form result ---> | |
<cfset formBean = $.event().getValue('formresult')> | |
<!--- Get a new content bean ---> | |
<cfset cBean = application.contentManager.getBean()> | |
<!--- Set the new node attributes ---> | |
<cfset cBean.setSiteID($.event('siteid'))> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
// Place these methods in your Site, Theme, or Plugin's eventHandler.cfc | |
public any function onBeforeUserSave($) { | |
var newUserBean = arguments.$.event('userBean'); | |
var oldUserBean = arguments.$.getBean('user').loadBy(userid=arguments.$.event('userid')); | |
// if you want to stuff the oldUserBean in the event | |
// $.event('oldUserBean', oldUserBean); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- 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($){ |
OlderNewer