Last active
December 22, 2015 00:49
-
-
Save stevewithington/6392020 to your computer and use it in GitHub Desktop.
Mura CMS : You don't have to rely on Mura's $.static() method ... you can create your own reference to CFStatic.
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') | |
); | |
</cfscript> | |
<!--- then, wherever you want to render any includes files, you could use the following syntax ---> | |
<cfoutput> | |
#$.cfStatic.include('/css/yourpackage/').renderIncludes('css')# | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment