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.

eZ debug

Timing: Jan 18 2025 16:08:45
Script start
Timing: Jan 18 2025 16:08:45
Module start 'layout'
Timing: Jan 18 2025 16:08:45
Module start 'content'
Timing: Jan 18 2025 16:08:45
Module end 'content'
Timing: Jan 18 2025 16:08:45
Script end

Main resources:

Total runtime0.6640 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0039 588.0313152.6406
Module start 'layout' 0.00400.0020 740.671939.4766
Module start 'content' 0.00600.6567 780.1484529.3281
Module end 'content' 0.66270.0013 1,309.47668.1250
Script end 0.6640  1,317.6016 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4694160.0002
Check MTime0.00140.2035160.0001
Mysql Total
Database connection0.00070.099410.0007
Mysqli_queries0.621993.6556540.0115
Looping result0.00050.0690520.0000
Template Total0.638296.120.3191
Template load0.00220.327720.0011
Template processing0.636095.785820.3180
Template load and register function0.00010.016610.0001
states
state_id_array0.00130.197010.0013
state_identifier_array0.00110.158720.0005
Override
Cache load0.00180.2727190.0001
Sytem overhead
Fetch class attribute can translate value0.00060.093420.0003
Fetch class attribute name0.00080.127830.0003
XML
Image XML parsing0.00070.109220.0004
class_abstraction
Instantiating content class attribute0.00000.001030.0000
General
dbfile0.00070.1111180.0000
String conversion0.00000.001340.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
2content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/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
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 12
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs