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.

eZ debug

Timing: Jan 18 2025 16:17:15
Script start
Timing: Jan 18 2025 16:17:15
Module start 'layout'
Timing: Jan 18 2025 16:17:15
Module start 'content'
Timing: Jan 18 2025 16:17:16
Module end 'content'
Timing: Jan 18 2025 16:17:16
Script end

Main resources:

Total runtime0.7173 sec
Peak memory usage4,096.0000 KB
Database Queries66

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0049 589.2188152.6094
Module start 'layout' 0.00490.0028 741.828139.4297
Module start 'content' 0.00770.7084 781.2578580.0078
Module end 'content' 0.71610.0012 1,361.265616.1953
Script end 0.7173  1,377.4609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4911160.0002
Check MTime0.00150.2061160.0001
Mysql Total
Database connection0.00060.086410.0006
Mysqli_queries0.658191.7397660.0100
Looping result0.00070.0990640.0000
Template Total0.689696.120.3448
Template load0.00200.285620.0010
Template processing0.687695.856220.3438
Template load and register function0.00020.034710.0002
states
state_id_array0.00100.137610.0010
state_identifier_array0.00060.090520.0003
Override
Cache load0.00180.2501340.0001
Sytem overhead
Fetch class attribute can translate value0.00070.102920.0004
Fetch class attribute name0.00120.163570.0002
XML
Image XML parsing0.00070.099520.0004
class_abstraction
Instantiating content class attribute0.00000.003190.0000
General
dbfile0.00070.0916180.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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs