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.

eZ debug

Timing: Jan 18 2025 02:06:46
Script start
Timing: Jan 18 2025 02:06:46
Module start 'layout'
Timing: Jan 18 2025 02:06:46
Module start 'content'
Timing: Jan 18 2025 02:06:47
Module end 'content'
Timing: Jan 18 2025 02:06:47
Script end

Main resources:

Total runtime0.7862 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 589.1641152.6406
Module start 'layout' 0.00560.0031 741.804739.4766
Module start 'content' 0.00870.7760 781.2813559.9688
Module end 'content' 0.78470.0015 1,341.250012.1406
Script end 0.7862  1,353.3906 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4389160.0002
Check MTime0.00140.1818160.0001
Mysql Total
Database connection0.00080.102410.0008
Mysqli_queries0.730692.9197630.0116
Looping result0.00050.0692610.0000
Template Total0.755296.120.3776
Template load0.00200.255320.0010
Template processing0.753295.799120.3766
Template load and register function0.00020.020110.0002
states
state_id_array0.00090.113710.0009
state_identifier_array0.00190.235420.0009
Override
Cache load0.00170.2130350.0000
Sytem overhead
Fetch class attribute can translate value0.00060.071420.0003
Fetch class attribute name0.00170.217760.0003
XML
Image XML parsing0.00050.064820.0003
class_abstraction
Instantiating content class attribute0.00000.001660.0000
General
dbfile0.00160.1980160.0001
String conversion0.00000.001040.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
5content/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/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.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: 20
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs