Embedded images

Author Message

Christian Johansen

Friday 20 January 2006 3:05:35 am

I'm having a problem again... Yesterday I inserted some embedded images and it worked fine. Today however, without a clue of what I've done different - the images are gone. They display fine on the admin preview, and I can access the image with it's url as anonymous user (ie: index.php/<siteaccess>/media_files/<image>

The image is embedded with the embed nodeid="<nodeid>" element in a ezxmltext field. There are no errors in the logs, and template debug gives me this:

<!-- START: including template: design/standard/templates/content/datatype/view/ezimage.tpl (design:content/datatype/view/ezimage.tpl) -->
<br/>
<img src= width="" height=""  style="border: 0px;" alt="" title="" />
<!-- STOP: including template: design/standard/templates/content/datatype/view/ezimage.tpl (design:content/datatype/view/ezimage.tpl) -->
</p>
</div>
<div class="attribute-caption" style="width: px">
<!-- START: including template: design/standard/templates/content/datatype/view/ezxmltext.tpl (design:content/datatype/view/ezxmltext.tpl) -->
<!-- START: including template: design/standard/templates/content/datatype/view/ezxmltags/paragraph.tpl (design:content/datatype/view/ezxmltags/paragraph.tpl) -->
<!-- START: including template: design/standard/templates/content/datatype/view/ezxmltags/line.tpl (design:content/datatype/view/ezxmltags/line.tpl) -->
[Image title appears here]<br />
...

It looks like it doesn't find the image or something, but it was there yesterday, AND it is available to anonymous users. Any ideas?

Łukasz Serwatka

Sunday 22 January 2006 11:57:24 pm

Hi Christian,

Check in xhtml output if path in "src" attribute of <img> tag is correct. If is empty then problem probably is with image conversion system.

Have you tried to clear the image aliases cache? Do you use GD or ImageMagick?

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

Christian Johansen

Monday 23 January 2006 12:41:48 am

I've tried to clear all caches many times. the src attribute is empty: src= width="" and so on.
I don't think that image magick is the problem because I can upload images, embed them in articles and preview them fine in the administration interface. I can also view the images by direct url as a user. I just cannot embed them. If I do link href='ezobject://281' it links up and the image shows. But embedding does NOT work :(

In frustration I created an override for the embed/ezimage.tpl to try to see for myself what happened. This is what I did:

<h1>Class: "{$image_class}"</h1>
{default image_class=large
         css_class=false()
         alignment=false()
         link_to_image=false()
         href=false()
         target=false()
         hspace=false()
         border_size=0}

<h1>Class/default class: "{$image_class}"</h1>

{if $image_class|eq("")}
  {let image_class='large'}
<h1>Class: "{$image_class}"</h1>
{/if}

which output:
Class: ""
Class/default class: ""
Class: ""

I give up. What's the matter here?

Łukasz Serwatka

Monday 23 January 2006 2:01:43 am

Try with image.tpl template from design/base/override/templates/embed. Make sure that correct override rule exists in your override.ini.append.php file for public siteaccess.

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

You can restore orginal files from ezpublish tarbal.

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

Christian Johansen

Monday 23 January 2006 2:34:13 am

That worked when I put {attribute_view_gui attribute=$object.data_map.image}
I have no idea what happened here seing as it did work before... But now it works again, and I'm happy :) Thanks!

Łukasz Serwatka

Monday 23 January 2006 2:56:03 am

Great! :)

embeded object attributes you can access only via $object variable not via $node variable.

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.