ez.no / ezpublish / documentation / customization / tips & tricks / debugging templates
These documentation pages are no longer maintained. Please visit the new documentation site.
The template operator attribute can be used to generate a list of attributes from a template variable. You do that by:
{$myvariable|attribute}
i.e.
<br>module_result.content {$module_result.content|attribute(show, 1)} <br>node {$node|attribute(show, 1)} <br>node.data_map {$node.data_map|attribute(show, 1)} <br>node.object {$node.object|attribute(show, 1)} <br>DesignKeys:used {$DesignKeys:used|attribute(show, 1)}
This will generate a HTML table with all the attributes and their types. If a type is an array or a new object with attributes it will recursively display those as well until it has displayed 2 levels.
By supplying show as the first parameter you get the values of the attributes.
The second parameter determines how many levels it will expand, the default is 2.
A value of false() means there is no level limit, this can cause the web server to crash if there are infinite loops in the attributes.
The third controls whether the output should be in HTML or not. Pass false() to it to get text output.
Comments