Templates

Elephant uses ElephantMarker as the template parser. It's based on FreeMarker and adds the necessary configuration to operate with the Elephant IConstructor.

ElephantMarker uses a template root to locate templates. The template root is configured in the site.xml file.

Specialized frameworks

By default, ElephantMarker uses Semantic UI as a HTML & CSS framework. The template defaults to templates-semantic.

Templates are used at different levels to generate the final HTML, CSS and JavaScript.

Level

Usage

Root

Generate the HTML frame, including html, head and body tags. The template child is elephant.

Layout

Generate the page layout within body tag. This includes de web page header and its menus, the sidebar, responsive controls and contextual menus. The template child is layout.

Entities

Generate the layout for single entities. Usually entities templates are called by content iterators and entities made available to the template using variables. The template child use to have the entity name (ex. contact, dossier, document...).

Naming templates

The conventional way ElephantMarker uses to locate a template is by searching [templates_root]/[context]/[name]Template.html. The context variable is the child explained is the above table and helps to differentiate templates usage. Name is the actual template name and the marker appends Template.html.

This convention allows the overriding system Overriding templates .

Printer version
English09/15/20 07:40Lluís Turró Cutiller


© turro.org, 2011-2018

lluis@turro.org
Tel. +34 609323947