Templating in xSiteable consist of a two-fold process; first, the templates located in the "templates/styles/[your_chosen_style]/" directory for page layout and element setup, and the XSLT templates located in "xsl" and "templates/sites/[your_chosen_site]" for the actual generating of those pages and elements.

Without knowledge of XSLT, the easiest is by far changing the page templates, located in "templates/sites/[your_chosen_style]/". As an example, I'll point to a template of importance that build the current xSiteable website.

Style selector

But first we need to focus on an important environment variable that gives what templates that will be used. If you havn't set the environment variable called "XSITE_LAYOUT", it will default to, as you might expect, "default". (This is done in the "go" command explained under Building). Basically, this variable is used as the standard template, unless, in "templates/sites/[your_chosen_site]/sitemap.xml" there is specified otherwise with an explicit template. Here is an example of a page that will be rendered using the default template;

<item id="tm" name="Topic maps" />

And here is an example of a page that will be rendered with the "default-two-columns.xml" template;

<item id="people-johannesen" name="Alexander Johannesen" template="default-two-columns" />

And here is an example of a page that will be rendered after the set style environment variable template rule, which, if "XSITE_STYLE" is set to "yallamaloo", will mean "yallamaloo-two-columns" ;

<item id="people-johannesen" name="Alexander Johannesen" virtual-template="two-columns" />

The reason for the virtual templates is to provide a mechanism for creating various drastically different designs / layouts based on the same content and sitemap files. More on this later.


The most common used template, simply by carrying the name of the default style, will work as our example file;


___ <header>

___ ___ <logo />

___ ___ <crouton />

___ </header>

___ <body>

___ ___ <relations />

___ ___ <content />

___ ___ <resources />

___ </body>

___ <footer />


Every template starts with the <page> element, which is the root element. Then you can choose wheter it should have a header, body or a footer in it, and then, what elements that should be in each of these (or none, as demonstrated by the <footer /> element; empty element).

Most of the elements in these templates calls up their respective XSLT template, so, for instance, the <logo> element calls up the XSLT template "logo". The same goes for the following elements; <page>, <header>, <body>, <footer>, <logo>, <crouton>, <relations>, <content>, <resources>, <styleselector>, <columns>, <left>, <main>, <right>, <gutter>, <news> and <devider>. (These XSLT templates are all found in the "templates/sites/[your_chosen_site]/lib-layout-[layout].xml" file, so if your style is set to "default", your file would be "templates/sites/default/lib-layout-default.xml". More on this later) All of these elements are detailed in Layout and design.