A Zend_Layout is the default implementation of a template (there are other template engines like Smarty available) in Bigace.
It uses the the capabilities of Zend_Layout and has the power of a Zend_View including the Bigace specific ViewHelper.
Bigace uses a comment parser to fetch meta-information about the layout. Therefor you should put a comment like this in your layouts head:
<?php /* Description: a short description here Widgets: sidebar Contents: about,address Options: css=editor.css */ ?>
You can attach a thumbnail, so end-user get an idea of the layout when looking through the Layout Administration. This thumnail has to have the name “screenshot.png” and a width of 250px. Put it into your layouts public path.
If you want to rename the file use the options “screenshot” (see below) or store it in another path (see “Path” setting).
The “Options:” setting can be used to change some default behaviours and places. Currently the following keys are supported:
This Step-by-Step guide explains how to create your own layout using Zend components.
1) Our layout will be called “easy-fluffy”. As Bigace 3 uses naming conventions to calculate (resource) names like CSS path, you need to adapt “easy-fluffy” to your layout name!
2) We work in the Community 1, so you might need to adapt that as well, if you develop a template for Community 3.
/sites/cid1/views/layouts/easy-fluffy.phtmland copy your template code inside
Or to make it real quick, you can download EasyFluffy.zip and copy the extracted files to the above named locations.
You get a working layout that uses menus, app links, sitename and widgets and should be easy to customize to your own needs.
Switch to the Layout Administration and see if your new layout shows up there with name and description.
To test your new layout, set it as default or apply it to a single page and open that page in the browser.
After your layout is now ready for work, take a screenshot and save it (with a width of 250px) at
/public/cid1/EasyFluffy/screenshot.png. This thumbnail will then show up in the Layout Administration beside the layouts name and description.
To replace static parts of you template with CMS data, you use the available Bigace specific ViewHelper.
You call ViewHelper in the way you would call class methods from within the class.
<h1><?php echo $this->sitename(); ?></h1>
As your layout is interpreted as PHP file, you can also use plain PHP or the default ViewHelper shipped with the Zend Framework.