Template Tags
User Manual » Advanced Topics » Creating a New Theme » Template Tags
While the 'main_template.html' file does only consist of HTML (and JavaScript, CSS, PHP etc if you wish) there are some Zula/TangoCMS specific 'tags' that are used within it to display certain data. All tags are wrapped in curly braces '{' and '}'. Below are the predefined tags that you can use within the template files.
Sector Tags
In the previous section, Creating the 'sectors', sectors were made within the 'sectors.xml' file and were given a unique ID. This ID is then used as a tag within the 'main_template.html' file to say where the modules attached to that sector should be within the template. To places these tags within the template, simply use the format '{S3}' replacing the contents of the tag with the ID of the sector (it should always begin with 'S' and followed by numeric chars).
There is also one special sector tag, and that is '{SC}' which stands for 'Sector Content'. This tag will get replaced with the output of the requested controller/module.
General Tags
The following tags are general tags to provide you with some data to work with, and can be used in any view file (includes 'main_template.html' and 'module_wrap.html'.
- CONTROLLER_TITLE - Title set by the current loaded controller/module.
- DIR_BASE - Base Directory (e.g; /).
- DIR_ASSETS - Path to the 'assets' directory (e.g; ./assets).
- DIR_THEME - Path to the 'theme' directory (e.g; ./assets/themes).
- DIR_UPLOADS - Path to the 'uploads' directory (e.g; ./assets/uploads).
- EVENT_FEEDBACK - Error and Success message (in HTML format).
- META_DESCRIPTION - The value of the 'meta/description' Meta Data config key.
- META_KEYWORDS - The value of the 'meta/keywords' Meta Data config key.
- PAGE_ID - Unique ID of the requested page.
- PAGE_LINKS - Contains the Page Links (in HTML format).
- PAGE_TITLE - Formatted site title, using 'config/title_format' config key format.
- SITE_SLOGAN - Value of the 'config/slogan' setting.
- SITE_TITLE - Title of the website by its self (not formatted).
- URL_ADMIN - URL to the 'admin' site type.
- URL_CURRENT_ST - URL to the current site type.
- URL_MAIN - URL to the 'main' site type.
Module Wrap Tags
Each module when attached to a sector is 'wrapped' in the 'module_wrap.html' file, the following tags are available for use within that.
- CONTENT - Output of the module.
- DISPLAY_TITLE - Bool value used to toggle the module Title on/off.
- ID - Unique ID of the module.
- TITLE - Title of the attached module.