Hard Coding Modules

To give your theme a unique appearance and still take advantage of the dynamic nature of pages within Exponent, you may 'hard-code' a module into a theme.  Some examples typically used might be the menu, a search form, a site log in or a footer with information about the copyright.  Most had-coded modules MUST have a 'source' to reference the stored data, however some modules without configuration settings do not require a source such as login and simple navigation views.  Hard-coded modules may NOT be nested within other hard-coded modules (only one level deep), however a hard-coded container may nest other containers or modules.

Modules (controllers)

A module can be hard-coded into a theme via:

    'source"=>"@leftcol', // the source
    'title'=>'My Module Title',
    'chrome'=>true, /* chrome is false by default */
    'scope'=>'sectional', /* global(default), sectional, top-sectional */
    'params' => array('cat' => $cat->id)


The 'chrome' is the module configuration settings drop-down menu bar above each module.  This must be set to 'true' to display this menu, especially if any settings or permissions must or will be configured.

Module 'Scope'

There are three scopes for placing hard code modules into a theme, including the container.

  • global (which is the default), 'global' will show the same content on all pages.
  • sectional, 'sectional' will show unique content for each page, so modules/content must be added to each page individually. 
  • top-sectional, 'top-sectional' will show the same content for a page and its sub-pages, but unique to that top level page and its sub-pages.

Additional Parameters 'Params'

Any and all additional paraemeters needed must be passed within an array named 'params'.

Loading Help