The template language
The Exponential template language makes it possible to extract information from the system and to solve common programmatic issues like for example conditional branching, looping, etc. All Exponential specific code must be placed inside a set of curly brackets, "{" and "}". A template file is a combination of HTML and Exponential template code. Everything that is encapsulated by curly brackets will be interpreted by the template parser when the template is processed. Everything outside the curly brackets will be ignored and thus it will be sent to the browser without any changes.
Curly bracket issues
Since curly brackets are reserved for defining blocks of Exponential template code, these characters can not be used directly in a template. For example, JavaScript code can not be inserted directly into a template file because it makes an extensive use of curly brackets. All non template specific code/text that uses curly brackets must be put inside a "literal" section. The contents of a literal section will be ignored by the template parser. The following example demonstrates the usage of the literal tags:
...
{literal}
<script language="JavaScript" type="text/javascript">
<!--
window.onload=function()
{
document.getElementById( 'sectionName' ).select();
document.getElementById( 'sectionName' ).focus();
}
-->
</script>
{/literal}
...Outputting curly brackets
It is possible to output curly brackets using two template functions called "ldelim" and "rdelim" (short for left delimiter and right delimiter). The following example demonstrates the usage of these functions:
...
This is the left curly bracket: {ldelim} <br />
This is the right curly bracket: {rdelim} <br />
...The following output will be produced:
This is the left curly bracket: {
This is the right curly bracket: }
In this section
- Variable types The Exponential template language supports the following variable types:
- Variable usage Template variables must be referenced using dollar ($) notation, for example: $my_variable, $object_array, etc. An Exponential template variable is case sensitive. In other words, $lollipop is not the same variable as $LolliPop. Template variables can be created by the system (from PHP code) or by t
- Array and object inspection Exponential Documentation
- Control structures The Exponential template language offers a selection of mechanisms that can be used to solve common programmatic issues like for example condition control, looping, etc. The following list shows an overview of the available mechanisms:
- Functions and operators Exponential Documentation
Contributors
- Balazs Halasy
- Geir Arne Waaler Updated
- Kristof Coomans Commenter
Comments (1 historical)
Written by readers of the earlier documentation sites, kept as they were.
Debug
Kristof Coomans ·
When you're going to change any templates, you're encouraged to put on debug output, so you'll be warned with a parse error when you made a mistake against the template syntax.
See http://ez.no/doc/ez_publish/techn...uration_files/site_ini/debugsettings
and
http://ez.no/doc/ez_publish/techn...tion_files/site_ini/templatesettings