Problem retrieving module parameters from template

Author Message

Michael Scofield

Sunday 27 July 2008 8:39:44 pm

Hi.

I have a template file where I'm trying to read a parameter sent by the URL, but I can't.

For example, if I open:

http://mydomain.com/eng/content/view/full/172/var1/value1/var2/value2
It's using "content" module and "view" view.
Ordered parameter is only one: "full", and it's value is 172.
Unordered parameters are "var1" and "var2".

I've been unsuccessfully trying to read the unordered parameters from a template file doing the following code, but I couldn't:

{def $mp = module_params()}
{$mp.parameters.var1}

Why my two unordered parameters are not being listed inside $mp.parameters?

Thanks
Michael Scofield

Piotrek Karaƛ

Monday 28 July 2008 1:27:21 pm

The documentation says about module_params() operator:

It seems that it can only be called inside "pagelayout.tpl".

Have you seen that?

Have you tried:

http://mydomain.com/eng/content/view/full/172/(var1)/value1/(var2)/value2

?

Why not simply use $module_result.view_parameters?

Greets,
Piotrek

--
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

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 18 2025 11:04:42
Script start
Timing: Jan 18 2025 11:04:42
Module start 'layout'
Timing: Jan 18 2025 11:04:42
Module start 'content'
Timing: Jan 18 2025 11:04:43
Module end 'content'
Timing: Jan 18 2025 11:04:43
Script end

Main resources:

Total runtime0.8116 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.0469152.6406
Module start 'layout' 0.00530.0029 740.687539.4922
Module start 'content' 0.00830.8019 780.1797529.3281
Module end 'content' 0.81020.0014 1,309.50788.1250
Script end 0.8116  1,317.6328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4307160.0002
Check MTime0.00170.2081160.0001
Mysql Total
Database connection0.00100.128410.0010
Mysqli_queries0.764894.2312540.0142
Looping result0.00050.0555520.0000
Template Total0.779096.020.3895
Template load0.00260.316720.0013
Template processing0.776495.657620.3882
Template load and register function0.00010.014310.0001
states
state_id_array0.00110.139310.0011
state_identifier_array0.00200.246520.0010
Override
Cache load0.00220.2743260.0001
Sytem overhead
Fetch class attribute can translate value0.00070.085120.0003
Fetch class attribute name0.00140.173830.0005
XML
Image XML parsing0.00060.070720.0003
class_abstraction
Instantiating content class attribute0.00000.004030.0000
General
dbfile0.00070.0889170.0000
String conversion0.00000.000940.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
2content/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/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/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: 19
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs