Function reference
Template functions are the brace tags that control a template, as opposed to operators that compute values. This page lists them by where they are registered.
Contents
The template library
Registered in lib/eztemplate/classes/eztemplateautoload.php:
| Function | Syntax | Page |
|---|---|---|
def, undef | {def $a=1 $b=2}, {undef $a} | Variables and def |
set, let, default | {set $a=2}, {default name=value} | Variables and def |
if (elseif, else) | {if cond}...{elseif cond}...{else}...{/if} | If and conditions |
foreach | {foreach $list as $key => $item offset 1 max 3 reverse}...{/foreach} | Foreach loops |
for | {for 1 to 5 as $i}...{/for} | For loops |
while | {while cond}...{/while} | While and do loops |
do | {do}...{/do while cond} | While and do loops |
delimiter, break, continue, skip | inside loops | Foreach loops |
switch (case) | {switch match=$x}{case match=1}...{/case}{case}...{/case}{/switch} | Switch and case |
section (section-else, section-include, section-exclude) | {section loop=$list}...{/section} | Section (legacy) |
include | {include uri='design:path.tpl' name=value} | Include |
cache-block | {cache-block keys=... expiry=...}...{/cache-block} | Cache-block |
set-block, append-block | {set-block variable=$x}...{/set-block} | Set-block and append-block |
run-once | {run-once}...{/run-once} | Run-once |
ldelim, rdelim | {ldelim} prints { | Literal and delimiters |
literal | {literal}...{/literal} | Literal and delimiters |
sequence | {sequence name=seq loop=array( ... )} | older alternating values; prefer foreach ... sequence |
debug-timing-point, debug-accumulator, debug-log, debug-trace | {debug-log msg='...'} | Template debugging |
tool_bar | {tool_bar name=... view=...} | toolbars of toolbar.ini |
menu | {menu name=...} | menus of menu.ini |
The kernel: gui functions
Registered in kernel/common/eztemplateautoload.php (eZObjectForwardInit); each forwards to a template chosen by
the object it receives:
| Function | Draws | Template folder |
|---|---|---|
attribute_view_gui | a field for viewing | content/datatype/view/ (collect/ for information collectors) (attribute_view_gui) |
attribute_edit_gui | a field's edit form | content/datatype/edit/ |
attribute_result_gui, attribute_pdf_gui, attribute_diff_gui | collected results, PDF, version differences | content/datatype/result/, pdf/, diff/ |
node_view_gui | a node in a view mode | node/view/<view>.tpl (node_view_gui) |
content_view_gui | an object in a view mode | content/view/<view>.tpl (content_view_gui) |
related_view_gui, content_pdf_gui, content_version_view_gui | related objects, PDF, versions | |
class_attribute_view_gui, class_attribute_edit_gui | class definitions (administration) | |
event_view_gui, event_edit_gui | workflow events (administration) | |
collaboration_*, shop_account_view_gui | collaboration and shop account parts |
Extensions
explblock(explayouts) draws a layouts block.powercontent_create_gui,powercontent_attribute_create_gui(nxc_powercontent, where active).
Related pages
- Operator reference
- TPL syntax basics
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.