Forums / Developer / Problems when embedding images in v. 3.5
Eirik Alfstad Johansen
Thursday 06 January 2005 6:29:45 am
Hi,
I was wondering if anyone else has experienced problems embedding images in v. 3.5. After having related an object (of the Image class) and embedded it using:
<object id="object_id" />
...I get the following output:
<div class="object-right"> <div class="content-view-embeddedmedia"> <div class="class-image"> <div class="attribute-image"> <p> <img src= width="" height="" border="0" alt="" title="" class="" /> </p> </div> <div class="attribute-caption" style="width: px"> </div> </div> </div> </div>
Or am I missing something?
Sincerely, Eirik Alfstad Johansen http://www.netmaking.no/
Łukasz Serwatka
Thursday 06 January 2005 6:36:22 am
Hi, Eirik
This is from /design/admin/override/templates/embed_image.tpl
{let image_variation="false" align="center" href='' attribute_parameters=$object_parameters} {section show=is_set($attribute_parameters.size)} {set image_variation=$object.data_map.image.content[$attribute_parameters.size]} {section-else} {set image_variation=$object.data_map.image.content[ezini( 'ImageSettings', 'DefaultEmbedAlias', 'content.ini' )]} {/section} {section show=is_set($attribute_parameters.align)} {set align=$attribute_parameters.align} {section-else} {set align="center"} {/section} {section show=is_set($attribute_parameters.href)} {set href=$attribute_parameters.href} {section-else} {set href=""} {/section} {switch match=$align} {case match="left"} <div class="imageleft"> {section show=$href}<a href={$href|ezurl} target="{$attribute_parameters.target}">{/section} <img src={$image_variation.full_path|ezroot} alt="{$object.data_map.image.content.alternative_text|wash(xhtml)}" /> {section show=$href}</a>{/section} <div style="width: {$image_variation.width}px;"> {$object.data_map.caption.content.output.output_text} </div> </div> {/case} {case match="right"} <div class="imageright"> {section show=$href}<a href={$href|ezurl} target="{$attribute_parameters.target}">{/section} <img src={$image_variation.full_path|ezroot} alt="{$object.data_map.image.content.alternative_text|wash(xhtml)}" /> {section show=$href}</a>{/section} <div style="width: {$image_variation.width}px;"> {$object.data_map.caption.content.output.output_text} </div> </div> {/case} {case} <div class="imagecenter"> {section show=$href}<a href={$href|ezurl} target="{$attribute_parameters.target}">{/section} <img src={$image_variation.full_path|ezroot} alt="{$object.data_map.image.content.alternative_text|wash(xhtml)}" /> {section show=$href}</a>{/section} <div style="width: {$image_variation.width}px;"> {$object.data_map.caption.content.output.output_text} </div> </div> {/case} {/switch} {/let}
I don`t know reasons why eZ dev use displaing images in this way? But it should be easier, i think
Personal website -> http://serwatka.net Blog (about eZ Publish) -> http://serwatka.net/blog
Thursday 06 January 2005 6:44:28 am
Hi Luke,
I think you might be missing my point. As you can see from my initial post, all the image attributes are missing, and that's what my problem is.
Has anyone tried embedding images in v. 3.5 successfully?
Thursday 06 January 2005 6:49:03 am
I gave you right code
Just copy this embed_image.tpl file to your override templates folder and add
[embed_image] Source=content/view/embed.tpl MatchFile=embed_image.tpl Subdir=templates Match[class_identifier]=image
to your override.ini.append.php
I ve test it and works great.
Kristian Hole
Thursday 06 January 2005 8:05:09 am
Try to chmod -R 777 on your /var directory.
The empty image-tag has happened to me when generation of different sizes of images fails.
Kristian http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute
Friday 07 January 2005 2:43:30 am
Hi Kristian,
It seems that you were right. I was referencing an image variation that didn't exist (actually, I referenced none, thinking that the reference or original variation would show, but it didn't).
Thanks for the tip!