Forums / Developer / $module_result variable

$module_result variable

Author Message

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

David Santiso

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?

eZ debug

Timing: Jan 18 2025 02:12:16
Script start
Timing: Jan 18 2025 02:12:16
Module start 'content'
Timing: Jan 18 2025 02:12:17
Module end 'content'
Timing: Jan 18 2025 02:12:17
Script end

Main resources:

Total runtime1.0849 sec
Peak memory usage4,096.0000 KB
Database Queries200

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0101 587.6875180.8516
Module start 'content' 0.01010.9736 768.5391589.7813
Module end 'content' 0.98370.1011 1,358.3203333.3984
Script end 1.0849  1,691.7188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3794210.0002
Check MTime0.00150.1377210.0001
Mysql Total
Database connection0.00100.094510.0010
Mysqli_queries1.007992.89762000.0050
Looping result0.00160.14441980.0000
Template Total1.048496.620.5242
Template load0.00250.227520.0012
Template processing1.045996.406620.5230
Template load and register function0.00020.016010.0002
states
state_id_array0.00100.089910.0010
state_identifier_array0.00060.055320.0003
Override
Cache load0.00210.1929280.0001
Sytem overhead
Fetch class attribute can translate value0.00130.119140.0003
Fetch class attribute name0.00110.097250.0002
XML
Image XML parsing0.00100.096140.0003
class_abstraction
Instantiating content class attribute0.00000.000950.0000
General
dbfile0.00260.2372290.0001
String conversion0.00000.000930.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs