Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Last active August 4, 2016 05:02
Show Gist options
  • Save stevewithington/6383472 to your computer and use it in GitHub Desktop.
Save stevewithington/6383472 to your computer and use it in GitHub Desktop.
Mura CMS : How to dynamically append the content release date to the body area.
<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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment