FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

Enhanced Layouts & Basic Site Layout

v1.0.6 Public

Coldbox Module providing Enhanced Layouts & Basic Site Setup

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', 

Or maybe you want to override the pageDefaults with a new title

        '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.

  • addPageHead - Allows appending or overriding pageDefaults of any meta or other related head tags.
  • addPageHeadStyle - Allows appending a new style to the event on the fly.
  • addBodyTag - Allows injection of any string into the Body tag.
  • addHTMLTag - Allows injection of any string into the HTML tag.
  • addHeadTag - Allows injection of any string into the Head tag.
  • addPageHeadScript - Allows appending to the scripts within the head. This isn't recommended doing however there are cases where older IE support requires conditional script comment tags. Or perhaps you require jquery to be loaded before anything else on the page.
  • addPageBodyScript - Allows appending scripts at the end of the page. This is a best practice for page loading and async usage.
  • addPageBeforeEnd - Allows appending any string to the page before the end of the body content. Great for tracking code.

Setup & Installation

Add the pageDefaults to your Coldbox.cfc's Setting

settings = {
    // Page Default Setting
    pageDefaults = {
            {'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"}
            {"content":"width=device-width, initial-scale=1","tag":"meta","name":"viewport"},
            {"href":"//,fl_force_strip,g_center,h_16,w_16/nextstepguru-icon.ico","tag":"link","type":"image/x-icon","rel":"shortcut icon"},

Dependencies (0)

Dev Dependencies (0)

v.1.0.6 - bug fixed to how caching is handled
v1.0.5 - added directory detection of caching
v1.0.3 - updated menu structure and made it a series of arrays with support for multiple menu locations, role & user logged in support and more.
v1.0.0 - current release - still kinda buggy but I am working to resolve a few issues and I will expand the documentation shortly.


$ box install nsg-module-layout

No collaborators yet.
  • Feb 18 2015 03:48 PM
  • Jun 10 2016 05:27 AM
  • 1,776
  • 1,091
  • 13