The Page bakery knows 3 levels of hierarchy:
All layouts, pages and subpages are represented by a Smarty-Template. Each template is stored as an HTML file in pages/page-name.html
and can use all the template mechanisms known by Smarty. The available Smarty template variables can be found below.
pages/
which contains the layout code and includes the actual body's content at one point.
pages
entry in doc_config.php
. A simple page can be defined as follows:
Config::set('pages',array(
'index' => array('title' => 'Overview','iconCls'=> 'icon-home','layout'=>'layout')
)
);
This defines the page index
with some attributes. The attributes can be defined as you need them: You have access to those attributes in the template. There are only 3 attributes that are system-dependant:
layout
: If set, the defined layout file is used. Defaults to 'layout' (and thus, pages/layout.html as a template).subpages
: an array defining subpages. More on this topic can be found in the Subpages section.defaultSubpage
: Defines the default subpage to be shown.Variable name | Description | |
---|---|---|
$pages | Contains the 'pages' configuration array, enhanced with the actual pages links, which are either dynamic links for online-use or the link to a static html file when the page was being built for static usage. |
|
$config | Contains the whole Configuration as defined in doc_config.php , unmodified. |
|
$defaultPage | Contains the default page configuration array Same as one entry in $pages. The $defaultPage variable is always set, except an error occurs. The default page can be set by using Config::set('defaultPage','page-key'); , and, if not set, defaults to index . |
|
$page_key | Contains the page key as defined in the 'pages' array of the actual page. Useful for e.g. check if you are on a certain page: Highlight actual page's menu entry, for example. |
|
$sub_key | Contains the sub-page key as defined in the 'subpages' array of the actual page. Useful for example to check if a sub-page is selected or not. |
|
$sub_key | Contains the sub-page key as defined in the 'subpages' array of the actual page. Useful for example to check if a sub-page is selected or not. |
|
$page | Contains the actual page's config array, including calculated link. |
|
$sub | If a subpage within a page is defined and requested, $sub contains the
actual subpage's config array. |
|
$page_content | Contains the actual page's content. Only useful in layouts where you want the actual page's content to be displayed. |
|
$subpage_content | Same as the page_content variable, but contains the SUB-page content of an actual page. Only useful in pages which contain sub-pages. |
|