Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ronnieduke/9045272 to your computer and use it in GitHub Desktop.
Save ronnieduke/9045272 to your computer and use it in GitHub Desktop.
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');
}
// open calendar events in a blank template
if ( Right($.content('parentid'),3) != 'END' && $.content().getParent().getType() == 'Calendar' && $.content('type') == 'Page' ) {
$.content('template','blank.cfm');
}
}
}
<cfdocument format="pdf">
<cfoutput>
<h3>#HTMLEditFormat($.content('title'))#</h3>
#$.dspBody(body=$.content('body'),pageTitle='',crumbList=0,showMetaImage=0)#
</cfoutput>
</cfdocument>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment