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.