Forums / Developer / $module_result variable
David Santiso
Monday 14 March 2011 3:39:57 am
Thanks,
I am printing
<span>{</span><span>$module_result</span>.<span>view_parameters</span><span>}</span>
...
<span>{</span><span>$module_result</span>.<span>node_id</span><span>}</span>
and others variables and it shows nothing.
Florin Daniel
Monday 14 March 2011 4:17:36 am
{$module_result} is an object i think.
By using the "attribute" template operator, it is possible to quickly inspect the contents of arrays and template objects. The operator creates an overview of available keys, attribute names and/or methods in an object or an array. By default, only the array keys and object attribute names (also called identifiers) are shown. By passing "show" as the first parameter, the operator will also display the values.
The second parameter can be used to control the number of levels/children that will be explored (the default setting is 2). The following example demonstrates how the operator can be used to inspect the contents of an "ezcontentobjecttreenode" object.
<span class="line">{$node|attribute( show, 1 )}</span>
Marko Žmak
Monday 14 March 2011 11:04:17 am
It also depends on the template in which you are trying to use the $module_result variable, It's available only in pagelayout.tpl.
So if you put this:
{$module_result|attribute(show)}
in your pagelayout.tpl it will output all the attributes (and their values) of the $module_result variable. But if you put this code in override templates, you'll get nothing.
Also note that not all modules have view parameters.
-- Nothing is impossible. Not if you can imagine it! Hubert Farnsworth
Monday 14 March 2011 12:22:27 pm
I'm using it in 2zoneslayout1.tpl. I want to display a unordered variable. I've seen that it appears in pagelayout.tpl.
How can I use that unordered variable in 2zoneslayout1.tpl?