📚 Looking for current Exponential documentation? This site contains legacy SDK & API reference docs (eZ Publish era). For up-to-date 2026 product documentation, visit doc.exponential.earth.

  eztemplate / operator_list  

<< Functions  Type creators >> 

This is a complete list of all the operators you can use in Exponential 3 templates. Most operators are native to eZ template (general), some are specific for Exponential 3.

Execute

fetch
Executes a given fetch operation, and returns the result. The parameters are the module name, the operation name, and a hash of operation parameters corresponding to the given function_name in kernel/[module_name]/function_definition.php. A few examples:
Fetch the number of items in a list: E.g. {fetch('content','list_count',hash(parent_node_id,$node.node_id,sort_by,array(published,true()),class_filter_type,exclude,class_filter_array,array(1,24)))}
Fetch a class: Returns the content class defined by class_id. E.g. {fetch('content','class',hash(class_id,4))}
Fetch a class attribute: Returns one specific class attribute defined by attribute_id. The parameter version_id is optional (default 0) and defines the version of the attribute. E.g. {fetch('content','class_attribute',hash(attribute_id,140,version_id,0))}
Fetch a class attribute list: Returns an array of all attributes for one class defined by class_id. The parameter version_id is optional (default 0) and defines the version of the attributes. E.g. {fetch('content','class_attribute_list',hash(class_id,4,version_id,0))}

Locale

l10n
Localizes values, e.g. {42.50|l10n(currency)}. Allowed types are: time, shorttime, date, shortdate, currency or number.

Dates

datetime
Formats dates and times according to formats defined in datetime.ini. Custom formats in the template itself are also possible. E.g. {$date|datetime(mydate)}, {$date|datetime(custom,"%m %y")}
currentdate
Returns the timestamp of the current datetime. E.g. {currentdate()}

Debug

attribute
Helper attribute to print available methods in objects and arrays, by default it only shows the array keys and object attribute names but by passing show as parameter it will fetch the values. The second parameter can be used to controlled the number of children to expand, default is no limit which may give problems with values that loop. The returned result is an HTML table unless false() is passed as the third parameter. E.g. {$node|attribute(show)}, {$node|attribute(show,2,false)}

Output washing

wash
General character/string washing operator. The washing type is the first parameter, for now it only supports XHTML characters.

Text operations

concat
Concatenates values to one string. If you give it an array, it will concatenate the elements of the array. E.g. {concat('/var/',$node.node_id,'/')}
autolink
Converts all known links in a text to links that can be clicked. E.g. {"Some links: ftp://ftp.example.com me@example.com http://www.example.com"|autolink}

Unit operators

si
Handles unit display of values, most often used for showing sizes of files but can also be used for displaying units on other items such as meters, grams etc. The operator reads two parameters. The first tells the kind of unit type we're dealing with, for instance: byte, length. The second determines the behaviour of prefixes and is optional.
E.g.
{1025|si(byte)}
{1025|si(byte,binary)}
{1025|si(byte,decimal)}
{1025|si(byte,none)}
{1025|si(byte,auto)}
{1025|si(byte,mebi)}

Type creators

true
Creates a true boolean. Remember to use brackets, e.g. {true()}.
false
Creates a false boolean. Remember to use brackets, e.g. {false()}.
array
Creates an array. E.g. array(6,8,42)
hash
Creates an associative array. E.g. hash(name,'Ola Norman',age,26)

Control operators

cond
Evaluates clauses and returns the value of the first clause whose condition is true. Pairs of parameters are treated as clauses where the first is the condition and the second is the body. The last clause may have one parameter only in which case it is used as condition and body. E.g. {cond($b|ne(0),div($a,$b),0)} returns the result of $a/$b if $b is not 0, or 0 if it is.
first_set
Returns the first value which exists, this is useful if you want to make sure that you always have a value to work with, since you can put a constant as the last parameter and constants always exist. E.g. {first_set($a,$b,$c," ")} returns " " if none of the variables are set.

Logical operators

lt
Returns true if the input value is less than the first parameter. E.g. {1|lt(2)} returns true.
gt
Returns true if the input value is greater than the first parameter. E.g. {2|gt(1)} returns true.
le
Returns true if the input value is less than or equal to the first parameter. E.g. {1|le(1)} and {1|le(2)} returns true.
ge
Returns true if the input value is greater than or equal to the first parameter. E.g. {1|le(1)} and {2|le(1)} returns true.
eq
Returns true if the input value is equal to the first parameter, or if no input value is available it returns true if all parameters are equal. E.g. {1|eq(1)} returns true. {eq(1,true(),false()|not,0|inc)} returns true.
null
Returns true if the input value is null, which is not the same as 0. E.g. {0|null()} returns false.
not
Returns true if the input value is false. E.g. {false()|not()} returns true.
true
Creates a true boolean. Remember to use brackets, e.g. {true()}.
false
Creates a false boolean. Remember to use brackets, e.g. {false()}.
or
Evaluates all parameter values until one is found to be true, then returns that value. The remaining parameters are not evaluated at all. If there are no parameters or all elements were false it returns false. E.g. {or(false(),false(),true(),false())} returns true.
and
Evaluates all parameter values until one is found to be false, then returns that value. The remaining parameters are not evaluated at all. If there are no parameters it returns false, if no elements were false it returns the last parameter value. E.g. {and(false(),false(),true(),false())} returns false.
choose
Uses the input count to pick one of the parameter elements. The input count equals the parameter index. E.g. {0|choose("a","b","c")} returns "a".
contains
Returns true if the first parameter value is found in the input value, which must be an array. Currently it works the same way as the PHP function in_array() but it may later be extended to support more advanced matching.
E.g. $array|contains($myvalue)

Type operators

These operators generally correspond to the PHP functions of the same name, where they exist.

is_array
Returns true if the input or the first parameter is an array. If both input and parameter are supplied, the parameter will be used.
is_boolean
Returns true if the input or the first parameter is a boolean (true or false). If both input and parameter are supplied, the parameter will be used.
is_integer
Returns true if the input or the first parameter is an integer. If both input and parameter are supplied, the parameter will be used.
is_float
Returns true if the input or the first parameter is a floating point number. If both input and parameter are supplied, the parameter will be used.
is_numeric
Returns true if the input or the first parameter is a number or a numberic string (a string consisting of numbers). If both input and parameter are supplied, the parameter will be used.
is_string
Returns true if the input or the first parameter is a string. If both input and parameter are supplied, the parameter will be used.
is_object
Returns true if the input or the first parameter is an object (as opposed to a simple type like integer or float). If both input and parameter are supplied, the parameter will be used.
is_class
Returns true if the input or the first parameter is a class. If both input and parameter are supplied, the parameter will be used.
is_null
Returns true if the input or the first parameter is null. Note: The integer 0 is not the same as 'null', if you want to test for 0 use {$var|eq(0)} or {eq($var,0)} instead. If both input and parameter are supplied, the parameter will be used.
is_set
Returns true if the first parameter is not false. is_set does not take an input.
is_unset
Returns true if the first parameter is false. is_unset does not take an input.
get_type
Returns the type of the input or the first parameter as a string. If both input and parameter are supplied, the parameter will be used. If the data is an object, then the string 'object' and the classname will be returned. If the data is an array, then the string 'array' and the array count will be returned. If the data is a string, then the string 'string' and the string length will be returned.
get_class
Returns the class of the input or the first parameter as a string. If both input and parameter are supplied, the parameter will be used. If the data is not an object, false will be returned.

Arithmentic operators

sum
Returns the sum of all parameters.
sub
Subtracts all extra parameters from the first parameter, e.g. sub($a,$b,$c) equal $a - $b - $c.
inc
Increases either the input value or the first parameter with one.
dec
Decreases either the input value or the first parameter with one.
div
Divides all extra parameters with the first parameter, e.g. div($a,$b,$c) equal $a / $b / $c.
mod
Returns the modulo of the first input parameter divided by the second. E.g. mod(5,3) returns 2.
mul
Multiplies all parameters and returns the result.
max
Returns the largest value of all parameters.
min
Returns the smallest value of all parameters.
abs
Returns a positive value of either the input value or the first parameter. E.g. {abs(-1)} returns 1 and {abs(200)} returns 200.
ceil
Returns the next highest integer value by rounding up input value if necessary.
floor
Returns the next lowest integer value by rounding down input value if necessary.
round
Returns the rounded value of input value.
count
Returns the count of the input value.
How counts are interpreted:
- If the data is an array the array count is used
- If the data is an object the object attribute count is used
- If the data is a string the string length is used
- If the data is a numeric the value is used
- If the data is a boolean false is 0 and true is 1
- For all other data 0 is used

Image handling operators

These operators require the ImageMagick and/or ImageGD extension to work.

image
Creates and returns an image by flattening the image layers given as parameters. (This requires the ImageMagick or the ImageGD extension.) If a parameter is text it will be used as the alternative text. If the parameter is an array it will assume that the first element (0) is the image layer, and the second is a hash table with parameters for that layer.
The parameters that can be set are:
- transparency: float value from 0 to 1.0 (ie 0-100%)
- halign: horizontal alignment, use left, right or center
- valign: vertical alignment, use top, bottom or center
- x: absolute placement (works with left and right align)
- y: absolute placement (works with top and bottom align)
- xrel: relative placement, float value from 0 to 1.0. (works with left and right align)
- xrel: relative placement, float value from 0 to 1.0. (works with top and bottom align)
The x and xrel parameters cannot be used at the same time (same with y and yrel).
When right or bottom alignment is used, the coordinate system will shift to accommodate the alignment. This is useful for doing alignment and placement since the placement is relative to the current coordinate system. Right alignment will start the axis at the right (0) and go on to the left (width). Bottom alignment will start the axis at the bottom (0) and go on to the top (height).
Examples:
Merge two images: {image(imagefile('image1.png'|ezimage),imagefile('image2.png'|ezimage))}
Texttoimage: {'I is cool'|texttoimage('arial')}
Similar to above but now wrapped in an image object: {image('I is cool'|texttoimage('arial'))}
Loads image from file to display as layer: {imagefile('var/cache/texttoimage/church.jpg')}
Creates image object with one file image layer: {image(imagefile('var/cache/texttoimage/church.jpg'))}
Creates image object with 80% transparent text aligned in the top right corner:
{image("church",imagefile('var/cache/texttoimage/church.jpg'),array('I is cool '|texttoimage('arial'),hash('transparency',0.8,halign,right,valign,top)))}
imagefile
Creates and returns an image layer for the image file given as the first parameter. (This requires the ImageMagick or the ImageGD extension.) See the 'image' example.
texttoimage
Converts the input value, which should be a string, into an image. (This requires the ImageGD extension.) It can also be used with the 'image' operator to allow you to merge the output with another image. Use only the first parameter if you don't want to override the settings in the font class. The font classes are specified in settings/texttoimage.ini.
Accepts the following parameters:
- class: The font class, which is specified in settings/texttoimage.ini. Use for instance 'archtura'.
- family: The font family.
- pointsize: The point size of the font.
- angle: The angle, in degrees counterclockwise from horizontal, at which the text should be shown.
- bgcolor: The background color, specified as an array of three numbers from 0 to 255.
- textcolor: The text color, specified as an array of three numbers from 0 to 255.
- x: The horizontal text offset in pixels from the left side of the image.
- y: The vertical text offset in pixels from the top of the image.
- w: A number of pixels that specify how much wider than the default the image should be.
- h: A number of pixels that specify how much taller than the default the image should be.
- usecache: A boolean that decides whether to use cache, must be true() or false().
Examples:
{"This is not a text"|texttoimage('archtura')}
{"This is not a text"|texttoimage('archtura',,50,0,array(200,255,255),array(255,0,0),10,10,28,26,true())}

Exponential 3 kernel operators

For more information see the Kernel template operators tutorial.

ezurl
Makes sure that the url works for both virtual hosts and non-virtual host setups.
ezroot
Similar to ezurl but does not include the index.php.
ezsys
Returns values from ezsys. The available values are wwwdir, sitedir, indexfile, indexdir and imagesize.
ezdesign
Similar to ezroot but prefixes with the design directory.
ezimage
Similar to ezroot but prefixes image directory in the design.
exturl
Not finished. Will be used for storing a URL in the database with a unique id, this means that similar URLs across templates can be updated centrally without changing templates. This is useful if URLs are wrong or become dead.
i18n
Marks a string for translation. E.g. {"I like %1!"|i18n("design/standard",,array($food))} See the tutorial Translation and i18n for more information.
x18n
Marks a string in an extension template for translation. E.g. {"I like %1!"|i18n("myextension","design/standard",,array($food))} See the tutorial Translation and i18n for more information.

Exponential Copyright © 1998 - 2026 7x