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.