Since VTE is embedded inside Vivvo Templates .tpl files, that must be valid xHTML Transitional documents, we will skip “Hello World!” example.
VTE has only 14 instructions for loading and manipulating data, assigning custom JS and CSS, building control structures. In order to fetch specific data, VTE usually interacts with Vivvo Modules, such as box_article_list.
Variable modifiers can be applied to variables. To apply a modifier, specify the value followed by a | (pipe) and the modifier name. A modifier may accept additional parameters that affect its behavior. These parameters follow the modifier name and are separated by a : (colon). Also, all PHP built-in functions as well as custom PHP functions can be used as modifiers.
Variable modifier syntax is as follows
"{<VTE_function> | <modifier_function> : <additional_params>}"
Here are few simple modifier examples:
{* applying modifier to a variable *}
<vte:value select="{article.get_title|strtoupper}" />
{* using format_date to format the current date *}
<vte:value select="{article.created|format_date:'d/m/Y'}" />
{* counting the number of elements in a list *}
<vte:value select="{article_list|count}" />
{* using PHP built-in function as modifier for query parameter *}
<vte:param name="search_cid" value="{CURRENT_CATEGORY.get_id},{CURRENT_CATEGORY.get_descendent_ids|implode:','}" />
{* forcing number of characters for article abstract text *}
<vte:value select="{article.get_summary|NUMBER_OF_CHARACTERS}" />
VTE commes with improved support for handling PHP object/arrays. Now its possible to directly access array elements referencing element of an array within square brackets '[' and ']'.
<vte:value select="{my_list[3]}" />
or even access methods of array element:
<vte:value select="{article_list[3].get_title}" />
Since Vivvo 4.1 you can also chain object methods:
<vte:value select="{article.get_category.get_image}" />
All this can be used in combination with variable modifiers.
Lets demonstrate how to use VTE through several examples.
Well, I guess you're on your own now :)