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 do not require a source such as login and navigation.
Hard Coding a 2.0 module
All of the 2.0 modules can be hard-coded into a theme via:
expTheme::module(array(
'module'=>'example', // 'controller' is an acceptable alternative
'action'=>'showall_examples',
'view'=>'custom_view', // 'action' is implied as in showall_examples_custom_view
'source"=>"@leftcol', // the source
'title'=>'My Module Title',
'chrome'=>true, /* chrome is false by default */
'scope'=>'sectional' /* global(default), sectional, top-sectional */
));
Module Scopes
There are three scopes for placing hard code modules into a theme.
- 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.
Loading Help
