iono Documentation - Layout Templates

iono uses the same method of templating as all Olate products by having all templates in plain HTML and available to edit and change by all customers. The template system is powered by the open source Savant Template System for PHP:

Savant is a powerful but lightweight object-oriented template system for PHP. Unlike other template systems, Savant by default does not compile your templates into PHP; instead, it uses PHP itself as its template language so you don't need to learn a new markup system. Savant has an object-oriented system of template plugins and output filters so you can add to its behavior quickly and easily.

Directories

Stored in the templates/iono/ directory by default, the templates are split into several sections which are all separated from each other. This means that you can safely modify just the frontend and order system without affecting the admin panel. This is handy because many customers only need to customise these parts to fit into their own websites and are quite happy to use the default admin style because it is not seen by customers.

The directory structure is very simple:

templates/  
--iono/  
----admin/  
----frontend/  
----js/  
----mailer/  
----order/

The admin/ frontend/ and order/ directories control those parts of iono. Each of these contain a standard set of directories:

css/  
global/  
images/

The css/ directory contains the stylesheets which are used to control the colours, fonts and sizes of the text and other elements of the design. The global/ directory contains the header and footer templates which are prepended and appended to every page. And any images are stored in the images/ directory.

JS/Mailer

A small amount of Javascript is used in the admin panel to perform immediate calculations when adding and editing invoices. The JS is stored in the js/ directory. All e-mails sent are sent from plain text templates, which are stored in the mailer/ directory.

Template Syntax

All the templates are saved in the form of templatename.tpl.php. This means they are essentially PHP files and can be edited with any normal text editor. The templates can use any form of scripting language - HTML, XHTML, Java, JavaScript etc. This includes the use of PHP.

PHP within templates

Although "standard" PHP can be used in the templates, it is recommended that any processing is kept out of the template files and instead placed into the PHP source files. Any PHP that is required in the templates should be kept to a minimum. When using control structures, the Alternative syntax for control structures should be used. The Olate Coding Standards apply to all templates.

Available variables

The following variables are available in templates. Each is an array and can be used like any normal PHP array.

All data submitted via HTTP POST. This data has been passed through basic cleaning functions but has no type checking or advanced type based sanitisation.

$this->vars_post

All data submitted via HTTP GET. This data has been passed through basic cleaning functions but has no type checking or advanced type based sanitisation.

$this->vars_get

All data submitted via HTTP REQUEST (combination of POST and GET, as well as other data). This data has been passed through basic cleaning functions but has no type checking or advanced type based sanitisation.

$this->vars_request

All data stored in the SESSSION array. This data has no cleaning.

$_SESSION

All system settings

$this->settings