how to access $module_result

Author Message

Oliver Dzierzon

Wednesday 04 March 2009 9:00:32 am

Hello,

its me once again.

How can I access $module_result from outside the pagelayout.tpl template.

I have a override template in which I have to switch between two views

My override template full/filedownload.tpl has the following code.

{if $module_result.section_id | eq("15")}
	<div>{attribute_view_gui attribute=$object.contentobject_attributes[1] view="ezbinaryfilelist"}</div>
{else}
	<div>{attribute_view_gui attribute=$object.contentobject_attributes[1] view="ezbinaryfile"}</div>
{/if}

or which other method is avaiable to fetch the current section_id

thank you.

Ivo Lukac

Wednesday 04 March 2009 11:05:02 am

Hello Oliver,

you can't use $module_result in full view.

for section use $node.object.section_id or $object.section_id depending on what view template using

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Piotrek Karaƛ

Wednesday 04 March 2009 9:16:38 pm

$module_result variable actually holds of what was generated in the full view of a node, or a custom view. Views are <b>generated before</b> the pagelayout is, so there's no way to pass variables from pagelayout to view, but it is possible the other way round using <b>persistent variables</b>.

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Oliver Dzierzon

Thursday 05 March 2009 1:50:17 am

Thank You !

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 06:16:44
Script start
Timing: Jan 31 2025 06:16:44
Module start 'layout'
Timing: Jan 31 2025 06:16:44
Module start 'content'
Timing: Jan 31 2025 06:16:45
Module end 'content'
Timing: Jan 31 2025 06:16:45
Script end

Main resources:

Total runtime0.5785 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0048 588.1328151.2109
Module start 'layout' 0.00480.0029 739.343836.6484
Module start 'content' 0.00770.5701 775.9922986.7422
Module end 'content' 0.57780.0007 1,762.734411.8516
Script end 0.5785  1,774.5859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00300.5158160.0002
Check MTime0.00130.2167160.0001
Mysql Total
Database connection0.00060.096110.0006
Mysqli_queries0.519089.7127620.0084
Looping result0.00050.0927600.0000
Template Total0.530791.720.2653
Template load0.00180.304920.0009
Template processing0.528991.428620.2644
Template load and register function0.00130.229010.0013
states
state_id_array0.00450.781010.0045
state_identifier_array0.00150.251520.0007
Override
Cache load0.00150.2564210.0001
Sytem overhead
Fetch class attribute can translate value0.00060.103930.0002
Fetch class attribute name0.00210.370360.0004
XML
Image XML parsing0.00320.548230.0011
class_abstraction
Instantiating content class attribute0.00000.002560.0000
General
dbfile0.01272.2015240.0005
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs