ez.no / exponential / documentation / development / libraries / ez template / operators / miscellaneous
These documentation pages are no longer maintained. Please visit the new documentation site.
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.
{1025|si(byte)} {1025|si(byte,binary)} {1025|si(byte,decimal)} {1025|si(byte,none)} {1025|si(byte,auto)} {1025|si(byte,mebi)}
This is a complete list of all the operators you can use in Exponential templates. Most operators are native to eZ template (general), some are specific for Exponential.
Localizes values, e.g.
{42.50|l10n(currency)}
Allowed types are: datetime, shortdatetime, time, shorttime, date, shortdate, currency or number.
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")}
Returns the timestamp of the current datetime. E.g.
{currentdate()}
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)}
General character/string washing operator. The washing type is the first parameter:
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,'/')}
Converts all known links in a text to links that can be clicked. E.g.
{"Some links: ftp://ftp.mysite.com me@mysite.com http://www.mysite.com"|autolink}
The ezini() operator enables access to the variables in the *.ini files. It takes three arguments:
{ezini('[section]','[variable]','[ini file]')}
For example to differentiate between locale settings, use template code similar to the follwing:
{section show=eq(ezini('RegionalSettings','Locale'),"eng-GB")} ... display por-PT link {section-else} ... display eng-GB link {/section}
Makes sure that the url works for both virtual hosts and non-virtual host setups.
he last parameter value. E.g.
{and(false(),false(),true(),false())}
returns false.
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".
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)
Comments
Dates from Attributes
Marco Zinn
Sunday 18 July 2004 6:56:42 pm
{$node.object.data_map.datum.data_int} to get the unix timestamp ("datum" is the attribute identifier)
Of course, you don't want to print the timestamp, so do something like this:
{$node.object.data_map.datum.data_int|l10n(shortdate)}
to get a nice, localized daten print.
ezurl and related types
Björn Dieding@xrow.de
Thursday 25 March 2004 6:54:20 pm
{'content/view/full/2'|ezurl('single')} -> 'index.php/content/view/full/2'
more types
Thomas Brandl
Thursday 24 July 2003 5:33:03 pm
+ datetime
others?