Image Nightmare

Author Message

Simon Phillips

Thursday 10 February 2005 3:03:24 pm

Hi,

Having spent the past <b>two days</b> reading hundreds of posts on how to display images, I am still unable to display content images within my ezpublish templates. Please help! I'm beginning to go mad...

I am using 3.5.0, and have created an article using the standard 'article' class (for which the image field is of type 'object relation'). I know want to display both the article text, and corresponding image together.

I have overridden the node/view/full template for the article class, with the following:

{*?template charset=utf-8?*}
<div class="pagetitle">
    {attribute_view_gui attribute=$node.object.data_map.title}
</div>
<div class="imageleft">
{attribute_view_gui attribute=$node.object.data_map.image image_class=medium}
</div>
{attribute_view_gui attribute=$node.object.data_map.intro}
{attribute_view_gui attribute=$node.object.data_map.body}

This displays the article nicely, but - as with many other people - the image is just a link to the image object and isn't displayed at all.

Having read suggestions in these forums to override /content/view/embed.tpl for the image object, I tried, to no avail. Now that I've enabled template debugging, I see the following templates are being invoked:

design/gv/override/templates/article_view_full.tpl (my article override template)

which then invokes the following template when loading the image:
design/standard/templates/content/view/text_linked.tpl

Why is text_linked being invoked? Should I be overriding text_linked to make my image display? This seems more than a little odd!

Please can someone tell me what to do - or where to look for a setting to change. I'm tearing my hair out.

I'm very impressed with ez - and the power it offers. However, I do feel somewhat let down by the documenation - the basic stuff is great (tscm website, etc) - but there's little more beyond that. Am I missing some great resource or something? The learning curve for anything more than very basic stuff seems to very steep. I'm determined to get there though!

Thanks,
Simon

Marko Žmak

Thursday 10 February 2005 3:31:38 pm

You HAVE to override:

content/view/embed.tpl

Try finding it somewhere on the complete template list. You'll probably have to list few pages, but you'll find it.

As for the documentation, you're right, it is poor.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Simon Phillips

Friday 11 February 2005 12:15:47 am

Thanks for your reply.

I currently have an override on /content/view/embed.tpl:

The override matches class_identifier : image
It currently contains a copy of the contents of the ezimage.tpl file from within the admin overrides - as suggested elsewhere. However, as you can see from the template trace above, it's never invoked - it seems that for some reason, /content/view/embed.tpl - or my override - is never being touched. Which would explain why they're not appearing. <i>But why?!</i>

Simon

bisk

Friday 11 February 2005 1:29:14 am

I think this should work:

...

<div class="imageleft">
{attribute_view_gui attribute=$node.object.data_map.image.content.data_map.image image_class=medium}
</div>

...

-------------------------------
http://www.kookfijn.nl & http://www.magento.be

Simon Phillips

Friday 11 February 2005 1:50:33 am

Thanks! You are an utter <b>lifesaver</b>! That works beautifully.

So, if I understand correctly, ez wasn't able to determine the object class, and so wasn't rendering it using the correct template. Does anyone know why? Is my setup dodgy? Or should I always reference images with

{attribute_view_gui attribute=$node.object.data_map.image.content.data_map.image image_class=medium}

I believe I just copied and pasted code from the examples and tutorials here...

Thanks again,
Simon

Martin Crockett

Friday 11 February 2005 3:14:25 am

It's like group therapy...
It appearing to working for my problem (9/2/2005) also...

Roy Bøhmer

Friday 11 February 2005 3:18:33 am

To me it looks like your attribute is an object link, and the image you want to display is in the object you linked to.

$node.object.data_map.image refers to the attribute that contains the image-object. The last part (content.data_map.image) refers to the actual image.
At least this is the case when I use the syntax :-)

Roy

Marko Žmak

Friday 11 February 2005 5:55:18 am

This line worked for me:

{attribute_view_gui attribute=$node.object.data_map.image}

Have you tried clearing the cache. Also some cache directives can sometimes prevent some templates from loading. Try putting this line I suggested, clear all the cache and if then doesn't work try turning of completely the cache. If that doesn't work, I don't know what's the problem.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Simon Phillips

Friday 11 February 2005 6:16:44 am

I had tried clearing the cache, disabling the cache, enabling the cache, enabling debugging, disabling debugging, etc, etc... It's pretty much a clean install (manual one at that) with little else on top.

Fortunately the suggestion to use the longer attribute worked.

Now I'm stuck trying to understand the menu system... I need something like the thing on the right of here - a nice tree-based menu listing all nodes below a particular depth... but it's not working yet!

Cheers,
Simon

Łukasz Serwatka

Friday 11 February 2005 6:33:07 am

settings/override/image.ini.append.php

[ImageMagick]
IsEnabled=false

Clear the cache

What phpinfo says about GD library?

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

Simon Phillips

Friday 11 February 2005 7:05:18 am

Making those changes to remove ImageMagick unfortunately make no difference at all - I'm still getting just a link.

Both GD and ImageMagick are installed - and working. The files are being uploaded and resized fine in the storage area; They're just not being correctly templated by ez.

Łukasz Serwatka

Friday 11 February 2005 7:14:47 am

What is your output from

{attribute_view_gui attribute=$node.object.data_map.image}

or

{attribute_view_gui attribute=$node.data_map.image}

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

Łukasz Serwatka

Friday 11 February 2005 8:45:32 am

Optionaly you can use this

<img src={$node.data_map.image.content['medium'].url|ezroot} 
width="{$node.data_map.image.content['medium'].width}"
 height="{$node.data_map.image.content['medium'].height}" border="0"
 alt="{$node.data_map.image.content['medium'].text|wash(xhtml)}"
 title="{$node.data_map.image.content['medium'].text|wash(xhtml)}" />

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

Simon Phillips

Saturday 12 February 2005 4:47:57 am

Hi Luke,

I tried the following code, testing all of your suggestions:

<div class="imageright">
1:{attribute_view_gui attribute=$node.object.data_map.image.content.data_map.image}
2{attribute_view_gui attribute=$node.object.data_map.image}
3{attribute_view_gui attribute=$node.data_map.image}
4:<img src={$node.data_map.image.content['medium'].url|ezroot} 
		width="{$node.data_map.image.content['medium'].width}"
		 height="{$node.data_map.image.content['medium'].height}" border="0"
		 alt="{$node.data_map.image.content['medium'].text|wash(xhtml)}"
 title="{$node.data_map.image.content['medium'].text|wash(xhtml)}" />

</div>

with an image named "War and Greed", it came up with the following. As you can see, the longer {attribute_view_gui attribute=$node.object.data_map.image.content.data_map.image} code worked, but not any of the other versions...

<div class="imageright">
1:

    
        
    
    <img src="/var/gv/storage/images/media/images/war_and_greed_banners/257-2-eng-GB/war_and_greed_banners_large.jpg" width="256" height="287"  border="0" alt="Banners for 'war' and 'greed'" title="Banners for 'war' and 'greed'" />

    
    
    2   
<!-- START: including template: design/standard/templates/content/view/text_linked.tpl (design/standard/templates/content/view/text_linked.tpl) -->
<p class="small">design/standard/templates/content/view/text_linked.tpl</p><br/>
<a href="/media/images/war_and_greed_banners">War and Greed Banners</a>
<!-- STOP: including template: design/standard/templates/content/view/text_linked.tpl (design/standard/templates/content/view/text_linked.tpl) -->
3   
<!-- START: including template: design/standard/templates/content/view/text_linked.tpl (design/standard/templates/content/view/text_linked.tpl) -->
<p class="small">design/standard/templates/content/view/text_linked.tpl</p><br/>
<a href="/media/images/war_and_greed_banners">War and Greed Banners</a>
<!-- STOP: including template: design/standard/templates/content/view/text_linked.tpl (design/standard/templates/content/view/text_linked.tpl) -->
4:<img src="" 
		width=""
		 height="" border="0"
		 alt=""
 title="" />

</div>

Simon

Mark De Quidt

Saturday 12 February 2005 5:15:28 am

Warning: this is NOT a solution ;)

I installed ezPublish yesterday, after installing ImageMagick. During the initial "fine tuning", ImageMagick was detected, but the first gallery in the default setup "plain", did not show any image. I reinstalled ezPublish (purging and recreating the db), no change.

Rather discouraging: if a standard setup does not work, and it is so difficult to show a stupid flower... why should i investigate further? At the moment, I do not understand this all thread, it seems to me I need a lot of study, it seems to be you need to be an expert from the beginning.

www.AtheneumAntwerpen.be
www.OpenLeren.be

Marko Žmak

Saturday 12 February 2005 3:50:37 pm

It looks to me something strange is happening with your eZ. This code:

{attribute_view_gui attribute=$node.object.data_map.image}

works perfectly for me, haven't got a clue why it shouldn't. Maybe someone from eZ crew could give you a better answer.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

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 19:08:00
Script start
Timing: Jan 18 2025 19:08:00
Module start 'layout'
Timing: Jan 18 2025 19:08:00
Module start 'content'
Timing: Jan 18 2025 19:08:02
Module end 'content'
Timing: Jan 18 2025 19:08:02
Script end

Main resources:

Total runtime1.9158 sec
Peak memory usage4,096.0000 KB
Database Queries106

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 589.2188152.6094
Module start 'layout' 0.00700.0024 741.828139.4297
Module start 'content' 0.00941.9045 781.2578909.6563
Module end 'content' 1.91380.0019 1,690.914136.1953
Script end 1.9157  1,727.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.1679160.0002
Check MTime0.00130.0703160.0001
Mysql Total
Database connection0.00170.086610.0017
Mysqli_queries1.794993.68881060.0169
Looping result0.00110.05891040.0000
Template Total1.880898.220.9404
Template load0.00200.102720.0010
Template processing1.878998.073620.9394
Template load and register function0.00020.009510.0002
states
state_id_array0.00070.038210.0007
state_identifier_array0.00140.071120.0007
Override
Cache load0.00200.1053960.0000
Sytem overhead
Fetch class attribute can translate value0.00110.055770.0002
Fetch class attribute name0.00140.0731200.0001
XML
Image XML parsing0.00430.226370.0006
class_abstraction
Instantiating content class attribute0.00010.0036240.0000
General
dbfile0.00300.1577380.0001
String conversion0.00000.000340.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
16content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
29content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
10content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
7content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
8content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 72
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs