-
Notifications
You must be signed in to change notification settings - Fork 1
Assets in module
Every module should have possibility to include css and scripts. With CMF Lucent you can do it quite easealy. You have to specify assets in configuration file of your module:
"assets" : {
"css" : [
"assets/css/style.css",
"assets/css/style2.css"
],
"js" : [
"assets/js/script.js",
"assets/js/script2.js"
]
}
Paths have to be specified with respect to your module
All specified assets will be included in all controllers of your module, for instance, if you specified scripts in “test” module, scripts will be available only in “test” module.
Sometimes there are necessities to include assets globally (in all modules and controllers). To do that you have to set “global” property as true in configuration file:
"assets" : {
"global" : "true",
"css" : [
"assets/css/style.css",
"assets/css/style2.css"
],
"js" : [
"assets/js/script.js",
"assets/js/script2.js"
]
}