Custom selectbox for embedded objects

Author Message

Pascal France

Friday 23 April 2010 1:35:05 pm

Hi,

I would like to define a custom selectbox for embedded objects in order to set their width.

But I can't achieve such a thing.

Is there someone who could explain me how to proceed ?

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

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