This file contains hidden or 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> | |
// you can even trigger the display event | |
$.event('display', 'help'); | |
// place this in your Site or Theme eventHandler.cfc | |
public any function onDisplayRender($) { | |
var str = ''; | |
switch(arguments.$.event('display')) { | |
case 'someAction' : | |
try { |
This file contains hidden or 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
<!--- | |
This is one way to generate a custom meta image based on the content item's primary associated image. | |
You could use this method in several other ways as well, such as inside a content iterator, etc. | |
If the fileid passed into this method is not a valid image, then it will return an empty string | |
---> | |
<cfif Len($.getURLForImage($.content('fileid')))> | |
<cfscript> | |
img = $.getURLForImage( | |
fileid = $.content('fileid') // could be _any_ fileid in Mura | |
,size = 'custom' // small, medium, large, custom, or any other pre-defined image size |
This file contains hidden or 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> | |
groupBean = $.getBean('user').loadBy( | |
groupname='Admin' | |
, siteid=$.event('siteid') | |
); | |
// recordset | |
rsGroupMembers = groupBean.getMembersQuery(); | |
// iterator |
This file contains hidden or 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> | |
// first, obtain the mailing list ID | |
mlid = $.getBean('mailingListBean').loadBy( | |
name = 'Mailing List Name Goes Here' | |
, siteid = $.event('siteid') | |
).getMLID(); | |
mlm = $.getBean('mailingListManager'); |
This file contains hidden or 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 onRenderStart($) { | |
var local = {}; | |
if ( Right($.content('parentid'), 3) != 'END' && ListFindNoCase('News,Blog', $.content().getParent().getTitle()) && Len($.content('releaseDate')) ) { | |
local.newContent = '<h3>By #HTMLEditFormat($.content("credits"))#</h3><p class="releaseDate">#LSDateFormat($.content('releaseDate'))#</p>' & $.content('body'); | |
$.content('body', local.newContent); | |
} | |
} | |
</cfscript> |
This file contains hidden or 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's onSiteRequestStart() method | |
var themeAssetPath = arguments.$.siteConfig('themeAssetPath'); | |
arguments.$.cfStatic = new requirements.org.cfstatic.CfStatic( | |
staticDirectory = ExpandPath('#themeAssetPath#') | |
, outputDirectory = 'compiled' | |
, staticURL = '#themeAssetPath#/' | |
, minifyMode = 'package' | |
, checkForUpdates = !arguments.$.siteConfig('cache') | |
); |
This file contains hidden or 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> | |
// Mura CMS : How to alter sessiontimeout based on domain | |
// drop this in /config/cfapplication.cfm | |
host = getPageContext().getRequest().getHeader('Host'); | |
switch(host) { | |
case 'www.intranet.com' : | |
this.sessiontimeout = CreateTimeSpan(7,0,0,0); | |
break; | |
case 'www.not-intranet.com' : |
This file contains hidden or 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 function in your Site, Theme, or Plugin's eventHandler.cfc | |
public any function onBeforeContentSave($) { | |
// reference to the newBean | |
var newBean = arguments.$.event('newBean'); | |
// reference to the original contentBean | |
var oldBean = arguments.$.event('contentBean'); | |
// example on how to create some errors | |
var error = ''; |
This file contains hidden or 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 hidden or 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
<cffunction name="onAfterFormSubmitSave"> | |
<cfargument name="$"> | |
<cfoutput> | |
<p>The title of this page is: #$.content('title')#<br> | |
The form submitted is: #$.event('formbean').getValue('title')#</p> | |
<cfdump var="#$.event('formbean').getAllValues()#"> | |
<cfabort /> | |
</cfoutput> | |
</cffunction> |