BoxLang 🚀 A New JVM Dynamic Language Learn More...
The basic idea for this module is to drop it into a new project. Point the default event & default layout to this module and start tuning your app within a few minutes.
This module provides a way to add layout specific commands on the file per handler/action.
For example, lets say you want to add a new style on a specific event. Just announce it
announceInterception( state='addPageHeadStyle',
interceptData={"href":"mySpecialStyle.css","tag":"link","rel":"stylesheet"});
Or maybe you want to override the pageDefaults with a new title
announceInterception('addPageHead',{
'title': "My Cool Title",
'Description': "This is my awesome page description"
});
Currently there are nearly a dozen custom interception points preconfigured with more to come. This is my first stab at turning html pages into pure objects that can be manipulated at any point during the request.
settings = {
// Page Default Setting
pageDefaults = {
"styles":[
{"href":"/modules/nsg-module-layout/assets/css/bootstrap.css","tag":"link","rel":"stylesheet"},
{"href":"/modules/nsg-module-layout/assets/css/bootstrap-theme.css","tag":"link","rel":"stylesheet"},
{"href":"/modules/nsg-module-layout/assets/css/bootstrap-social.css","tag":"link","rel":"stylesheet"},
{"href":"/modules/nsg-module-layout/assets/css/font-awesome.css","tag":"link","rel":"stylesheet"},
{"href":"/modules/nsg-module-layout/assets/css/font-awesome-social.css","tag":"link","rel":"stylesheet"},
{"href":"/assets/css/sitewide.css","tag":"link","rel":"stylesheet"}
],
"scripts":[
{'ifComment'="lt IE 9",'tag':'script','src':"/modules/nsg-module-layout/assets/html5shiv.js"},
{'ifComment'="lt IE 9",'tag':'script','src':"/modules/nsg-module-layout/assets/respond.js"}
],
"head":[
{"content":"defaultTitle","tag":"title"},
{"content":"defaultDescription","tag":"meta","name":"description"},
{"charset":"utf-8","tag":"meta"},
{"content":"IE=edge","tag":"meta","http-equiv":"X-UA-Compatible"},
{"content":"on","tag":"meta","http-equiv":"cleartype"},
{"content":"width=device-width, initial-scale=1","tag":"meta","name":"viewport"},
{"href":"//res.cloudinary.com/nextstepguru/image/upload/c_pad,fl_force_strip,g_center,h_16,w_16/nextstepguru-icon.ico","tag":"link","type":"image/x-icon","rel":"shortcut icon"},
{"href":"https://www.nextstep.guru/","tag":"link","rel":"canonical"}
],
"body":{
"scripts":[
{'tag':'script','src':"/modules/nsg-module-layout/assets/js/jquery-2.1.3.js"},
{'tag':'script','src':"/modules/nsg-module-layout/assets/js/bootstrap.js",'async':true},
{'tag':'script','src':"/modules/nsg-module-layout/assets/js/modernizr.js",'async':true},
{'tag':'script','src':"/assets/js/sitewide.js",'async':true}
],
"end":[]
}
}
};
$
box install nsg-module-layout