CustomAttributes in [embed] section

Author Message

Pascal France

Friday 05 October 2007 5:17:35 pm

Hi,

I would like to add a "borderSize" CustomAttributes for embed images.
In content.ini.append.php I put:

[embed]
AvailableClasses[]
CustomAttributes[]=borderSize

So, I have a new "borderSize" option (with a field to fill in) in the "Insert object" popup displayed by OE.
But I don't underdant in which template I can recover the $borderSize variable ?
I have tried in
- design/base/override/templates/embed/image.tpl
and
- design/standard/templates/content/datatype/view/ezimage.tpl

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

Petr Mifek

Saturday 06 October 2007 9:43:34 am

A blind shot: did you try the $object_parameters.customattributename variable?

Pascal France

Saturday 06 October 2007 10:07:31 am

Hi Petr,

I'm not sure that I understood well what you mean, but {$object_parameters.border} does not work.
$object_parameters does not seem to be a valid variable.

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

Petr Mifek

Saturday 06 October 2007 11:13:23 am

Hi,

I'm pretty sure, that the customattribute shows up in the $object_parameters array. The other thing is what is the template.

If you are using standard setup with ezwebin interface, then st like this is defined for image in override.ini

[embed_image]
Source=content/view/embed.tpl
MatchFile=embed/image.tpl
Subdir=templates
Match[class_identifier]=image

in case of an unmodified standard ezwebin setup this would render into this template file being used:

extension/ezwebin/design/ezwebin/override/templates/embed/image.tpl

Anyway, if the object is embedded by an "embed" tag, then the template, you need to change, is some override of the content/view/embed.tpl (or the template itself, which is unlikely).

Try to switch on the debug in Quick setting in admin, "List of used templates" should tell you exactly what file is being used.

Pascal France

Monday 08 October 2007 5:55:39 pm

Thanks a lot Petr,

You're right and all work fine.

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 30 2025 21:42:15
Script start
Timing: Jan 30 2025 21:42:15
Module start 'layout'
Timing: Jan 30 2025 21:42:15
Module start 'content'
Timing: Jan 30 2025 21:42:15
Module end 'content'
Timing: Jan 30 2025 21:42:15
Script end

Main resources:

Total runtime0.0273 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 588.1563151.2109
Module start 'layout' 0.00650.0048 739.3672220.6875
Module start 'content' 0.01130.0143 960.05471,001.8203
Module end 'content' 0.02560.0017 1,961.875033.9922
Script end 0.0273  1,995.8672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00279.8504140.0002
Check MTime0.00124.5006140.0001
Mysql Total
Database connection0.00103.796310.0010
Mysqli_queries0.004014.715830.0013
Looping result0.00000.076810.0000
Template Total0.00124.510.0012
Template load0.00103.675010.0010
Template processing0.00020.761910.0002
Override
Cache load0.00072.628610.0007
General
dbfile0.002910.633280.0004
String conversion0.00000.041040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs