Last active
April 27, 2018 19:24
-
-
Save stevewithington/5197276 to your computer and use it in GitHub Desktop.
Mura CMS: dynamically change layout templates (e.g., Allow for a "View As PDF" link, or only open children of a calendar in a blank.cfm layout template ... this way you could open it in a modal window using shadowboxjs, etc.)
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'); | |
} | |
// open calendar events in a blank template | |
if ( Right($.content('parentid'),3) != 'END' && $.content().getParent().getType() == 'Calendar' && $.content('type') == 'Page' ) { | |
$.content('template','blank.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
<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
… and if you're NOT using bootstrap add < cfset $.loadShadowBoxJS() > in you footer.cfm