-
Notifications
You must be signed in to change notification settings - Fork 0
Creating a Layout
Layouts allow you to define an initial set of tags that will be used all over the site. Each layout tag can also be used to execute services via the service configuration. Because layouts only define tags the style for the layout should be done via a theme. (E.g. when you want to float certain tags)
Layouts should not contain all the tags you want to see in you website, rather it should contain the most basic tags that make out the frame of the site. The rest of your site tags should be created via the various services that are executed.
In this example a basic layout with a container div, header, article and footer are created.
In the /layouts folder, create a file called basic.xml
Add the following to the basic.xml file
<?xml version="1.0" encoding="UTF-8"?>
<layout name="basic"></layout>
Within your layout, add the following
<container><header/><article id="main" primary="true" /><footer /></container>
Tsama will create an equivalent HTML5 node for each tag in the layout. If no id is specified, the node will automatically be created with an id as per the name of the tag. If the tag name is not in the HTML5 standard, a div node will be create in its place E.g.
<container></container>
Will be created as
<div id="container"></div>
To activate the layout, replace $_TSAMA_CONFIG['LAYOUT'] = 'default' with basic in the /conf/site.conf.php file
It is possible to override the default configured layout by specifying another layout in the Service configuration file. This can only be done with primary services. See Configuring a Service
E.g.
<service name="basic" primary="true" layout="anotherlayout" >
Installation and Configuration
Predefined Constants and Globals
Creating a Layout