Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Last active December 21, 2015 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevewithington/6271863 to your computer and use it in GitHub Desktop.
Save stevewithington/6271863 to your computer and use it in GitHub Desktop.
Mura CMS : In 6.1, you will be able to define your own display events via 'display=someAction'
<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 {
savecontent variable='str' {
include '#arguments.$.siteConfig('themeAssetPath')#/display_objects/someAction.cfm';
}
} catch(any e) {
str = '<p>missing file</p>';
}
break;
case 'help' :
str = '<h1>Hey, you asked for HELP!</h1>';
break;
default :
str = '';
}
return str;
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment