How to control HTML produced by <embed>?

Author Message

Ciprian Popovici

Wednesday 01 March 2006 8:16:35 am

I've tried using <embed> to add some pictures to my pages. I'm hoping there is a simple way I can control the outcome. Ideally, I'd like my content editors to be able to add a small hint to the <embed> tag, such as left, right or center, and the resulting image and the surrounding HTML should be under my control. I suspect it has to do with the Image class and perhaps one of those many templates but I'm really lost.

I checked the HTML that's generated now and it's a mess. There are no less than 4 different DIV's surrounding the image tag, I can't seem able to add a class name of my choice (only ID, but I may have several images in a page), and to top it all of there's a <br /> in there which seriously messes up the layout.

Basically, I'd like the editor to write one of these:
<embed href="..." something="left">
<embed href="..." something="right">
<embed href="..." something="center">

and to get one of these, respectively:

<div class="left"><img ....></div>
<div class="center"><img ....></div>
<div class="right"><img ....></div>

Can this be done and how?

Ɓukasz Serwatka

Thursday 02 March 2006 11:49:57 pm

Hi Ciprian,

Output from embed objects is controlled by template in design/base/override/templates/embed/image.tpl for "base" design. You can change base template, or use this override rule and make override for your design:

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

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

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