Pass parameters through attribute_view_gui [Solved]

Author Message

Jean-Luc Nguyen

Friday 10 October 2008 3:08:12 am

Hello,

I need to pass a value to attribute_view_gui, like the image_class on ezimage.tpl, but my code is:

{attribute_view_gui prix_unite=2 attribute=$node.data_map.bouquet}

And then, on my template embed-bouquet.tpl, I cannot get the $prix_unite value. I really don't understand why.

{$prix_unite}
{default prix_unite=3}
<br />{$prix_unite}

It only displays the 3 value.

Thanks a lot!

http://www.acidre.com

Alain Sahli

Friday 10 October 2008 6:55:19 am

Hi,

Maybe its because you must first indicate the attribute...

    {attribute_view_gui attribute=$node.data_map.bouquet prix_unite=2}

http://www.wess.ch
eZ Publish Certified developer : http://auth.ez.no/certification/verify/272583

Yannick Komotir

Friday 10 October 2008 8:23:03 am

you can see here http://ez.no/doc/ez_publish/technical_manual/4_0/reference/template_functions/visualization/attribute_view_gui

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

Nabil Alimi

Saturday 11 October 2008 4:36:17 pm

Jean Luc,

You're passing the parameter through attribute_view_gui but it seems that you want to use the variable in a template that is not the attribute override template.

Well actually i'm wondering... Which template call which ?

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

Jean-Luc Nguyen

Monday 13 October 2008 2:34:06 am

Hello,

It seems like when activating the debug, it is a "different namespace" problem.. What is actually namespace? Is it the view?

http://www.acidre.com

Jean-Luc Nguyen

Tuesday 14 October 2008 5:57:47 am

I solved the problem by creating a global variable:

{set-block scope=global variable=prix_chaine_unite}2{/set-block}

So that in the "child" template, I can display the prix_chaine_unite:

{$#prix_chaine_unite}

The # means that the variable is a global one.

http://www.acidre.com

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 15:01:44
Script start
Timing: Jan 18 2025 15:01:44
Module start 'layout'
Timing: Jan 18 2025 15:01:44
Module start 'content'
Timing: Jan 18 2025 15:01:45
Module end 'content'
Timing: Jan 18 2025 15:01:45
Script end

Main resources:

Total runtime1.0108 sec
Peak memory usage4,096.0000 KB
Database Queries70

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.0391152.6406
Module start 'layout' 0.00450.0023 740.679739.4766
Module start 'content' 0.00681.0028 780.1563662.8125
Module end 'content' 1.00970.0011 1,442.968816.1250
Script end 1.0108  1,459.0938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3034160.0002
Check MTime0.00130.1297160.0001
Mysql Total
Database connection0.00060.061410.0006
Mysqli_queries0.947793.7568700.0135
Looping result0.00070.0666680.0000
Template Total0.984597.420.4922
Template load0.00190.189220.0010
Template processing0.982597.198420.4913
Template load and register function0.00010.011110.0001
states
state_id_array0.00070.067310.0007
state_identifier_array0.00110.109020.0006
Override
Cache load0.00170.1676350.0000
Sytem overhead
Fetch class attribute can translate value0.00050.046840.0001
Fetch class attribute name0.00130.1314100.0001
XML
Image XML parsing0.00330.330740.0008
class_abstraction
Instantiating content class attribute0.00000.0019120.0000
General
dbfile0.00220.2183340.0001
String conversion0.00000.000740.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
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs