Share » Forums » Setup & design » Custom selectbox for embedded objects

Custom selectbox for embedded objects

Custom selectbox for embedded objects

Friday 23 April 2010 1:35:05 pm - 4 replies

Author Message

Pascal France

Friday 23 April 2010 3:18:15 pm

At present I made this:

In extension/ezoe/settings/content.ini.append.php :

[embed]
CustomAttributes[]=test

In extension/ezoe/settings/ezoe_attributes.ini

[CustomAttribute_embed_taille]
Name=Taille
Title=Titre
Type=select
Selection[]
Selection[100]=100x100
Selection[200]=200x200

As I want to display the object (an image) in the edit interface (in the admin2 interface) I did an override in the admin siteaccess:

[embed_slideshow]
Source=content/view/embed.tpl
MatchFile=content/view/embed_slideshow.tpl
Subdir=templates
Match[class_identifier]=slideshow

and I placed the slideshow.tpl template in design/admin2/override/templates/content/view/embed_slideshow.tpl
Now I have a beautiful selectbox named «Taille» ;-)
Question: how do I fetch the value selected in the selectbox ? What's the name of the variable ? $object_parameters does not contains this value, neither $test nor $taille, etc....

Thinks for your help.

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Pascal France

Friday 23 April 2010 5:56:27 pm

$object_parameters is the key of the success ;-)

But this hash does not contain the selected value of the custom tag when we are in edit mode. The value is available in preview mode only. Therefore the first image (I fetch the first image of the slideshow only) is not display in edit mode.

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Nicolas Pastorino

Saturday 24 April 2010 9:43:33 am

Sounds like you made your way Pascal, congratulations !

Cheers

--
Nicolas Pastorino
Director Community - eZ
Member of the Community Project Board

eZ Publish Community on twitter: http://twitter.com/ezcommunity

t : http://twitter.com/jeanvoye
G+ : http://plus.tl/jeanvoye

Pascal France

Saturday 24 April 2010 7:07:42 pm

You are too good with me Nicolas ;-)

Sometimes, when I meet a problem which I can't solve after having looked well, I need to post to stand back. The only fact of writing my problem advances me.

Ggiven the hours to which I post, I should not disturb many people ;-)

Cordially,

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu