The Page Bakery comes with the following directory structure:
pagebakery |- pages/ | |- *.html |- php/ |- static/ |- tmp/ <--- Make sure this is writable by the web server / user |- index.php |- generate_static.php |- doc_config.php
The installation procedure is very simple: Just copy the whole pagebakery folder to e.g. your webroot. The pagebakery folder itself can be renamed to whatever you need.
Point to the index.php file in your web browser, and you should get this documentation.
All configuration is done in doc_config.php. The configuration is done by setting Configuration variables using the Config::set()
method, e.g.:
Config::set('config-key','config-value');
The most important config key and most probably the only one to set is the pages
configuration: It is an array containing an entry for each page you want to display.
Let's begin with an example, the configuration for this documentation:
Config::set('pages',array(
// Signature: 'page-key' => config array
'index' => array('title' => 'Overview','iconCls'=> 'icon-home'),
'usage' => array('title' => 'Usage','iconCls' => 'icon-wrench','layout'=>'layout'),
'credits' => array('title' => 'Credits','iconCls' => 'icon-globe'),
'contact' => array('title' => 'Contact','iconCls' => 'icon-comment')
));
Each page-key of the config array corresponds to a pages/<key.html>
file, which represents the page content template for a single page. The value in the pages array is a config array, which can be accessed in the template. This config array knows the following special values:
layout
: If set, the defined layout file is used instead of the global layout file.link
: Set at runtime by the framework, represents the (relative) link to the generated page, either a dynamic or static link.subpages
: an array defining sub-pages of the actual
page, in the same format as the page itself.defaultSubpage
: The name of the subpage to be
displayed if this page is not called with a subpage request.Please refer to the original doc_config.php
for more options. Most of them are self-explanatory, and the file is well-commented. Let's create some pages now!