images not shown

Author Message

Toni Ascó

Sunday 11 April 2004 1:55:00 am

Hi, i'm using the online editor to edit my articles.
When i try to insert an image (using the magnifying glass and such) the online editor inserts a piece of code like:

<object id=a_number size=msmall>

But when the article is displayed i only see a link where i should see an image.

Any idea?

Thanx in advance,
Toni

Lazaro Ferreira

Monday 12 April 2004 9:44:40 am

Hi,

It seems that you are getting the result of the default image template, that shows a link to the image object, instead you should get the embed image template (you will need to verride this) that shows the image within your i.e article, or info_page.etc

Lazaro
http://www.mzbusiness.com

Toni Ascó

Monday 12 April 2004 10:00:14 am

Thanx Lazaro, it workerd! :)
Now i face another problem, how can i get the image_size and the alignment?

At the momment i have them as a default mode (medium and center) but if i set small and left in the online editro i expect to put those values in the template override.
I see that embed.tpl gets the attributes in the very first line, but i don't know how to acces to those attributes from ezpublish code...

Any idea?

Thanx in advance,

Toni

Lazaro Ferreira

Wednesday 14 April 2004 11:07:11 am

Hi,

This is the image_embed.tpl supplied with EZP Portal Setup

{let image_variation="false"
     align="center"
     href=''}

{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["medium"]}
{/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}>{/section}
<img src={$image_variation.full_path|ezroot} />
{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}>{/section}
<img src={$image_variation.full_path|ezroot} />
{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}>{/section}
<img src={$image_variation.full_path|ezroot} />
{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}

Look at the section :

{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["medium"]}
{/section}

As you see, you can change "medium" size for another one there, it should works

-----------
Lazaro

Lazaro
http://www.mzbusiness.com

bob barker

Sunday 18 April 2004 5:07:50 pm

I have followed this and other threads on the same subject, but I simply do not understand the solution. Could someone step me through how exactly to embed an image in a news article and actually have it displayed? I use the on-line editor, I insert an image object and it shows up in the article in admin mode. In user mode it shows as a text link to the image file. How, exactly, do I override the default template to use some other template, and what does the other template look like?

Please help - this is incredibly frustrating - embedding an image into text should not be this difficult!

Bruce Morrison

Sunday 18 April 2004 7:45:56 pm

1. Copy design/admin/override/templates/embed_image.tpl to design/<<your design>>/override/templates/embed_image.tpl
2. Add

 [embed_image]
Source=content/view/embed.tpl
MatchFile=embed_image.tpl
Subdir=templates
Match[class]=5

to settings/siteaccess/<<your siteaccess>>/override.ini.append
3. Clear cache

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

bob barker

Monday 19 April 2004 6:12:19 am

Bruce, thank you, however ....

I Have done exactly as indicated. But the images still show up as text links to the image.
Yes, I did clear the caches and yes, they are valid image files. If you would like access to the site, send me a clear email address and I will send you the id and password.

Bob Barker
bob.barker@newxco.com

bob barker

Monday 19 April 2004 6:55:39 am

After much checking/rechecking and so on, it now works and I am convinced that something is odd with cache clearing. I used the clear all cache link in the admin screens but images still do not appear, however, if I clear each cache individually then lo and behold .... images in the articles.

Probably this is all just a figment of my imagination, but are you sure that the clear all cache button works??

Thanks for your help - I was on the right track, but cache clearance was masking the reolution.

Felix Laate

Tuesday 04 May 2004 1:56:46 pm

I have experienced the same thing many times with the 3.2-x and 3.3-x series. Never trust the "clear all" option! Do it manually!

Is this a bug?

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

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 19 2025 01:15:23
Script start
Timing: Jan 19 2025 01:15:23
Module start 'layout'
Timing: Jan 19 2025 01:15:23
Module start 'content'
Timing: Jan 19 2025 01:15:24
Module end 'content'
Timing: Jan 19 2025 01:15:24
Script end

Main resources:

Total runtime0.9491 sec
Peak memory usage4,096.0000 KB
Database Queries81

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 589.0547152.6094
Module start 'layout' 0.00710.0031 741.664139.4141
Module start 'content' 0.01020.9373 781.0781725.5859
Module end 'content' 0.94750.0016 1,506.664120.1875
Script end 0.9491  1,526.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3494160.0002
Check MTime0.00140.1483160.0001
Mysql Total
Database connection0.00110.113010.0011
Mysqli_queries0.870191.6697810.0107
Looping result0.00100.1089790.0000
Template Total0.912996.220.4564
Template load0.00220.228820.0011
Template processing0.910795.951220.4554
Template load and register function0.00020.024410.0002
states
state_id_array0.00100.106510.0010
state_identifier_array0.00170.180820.0009
Override
Cache load0.00190.2014570.0000
Sytem overhead
Fetch class attribute can translate value0.00060.066850.0001
Fetch class attribute name0.00120.1237110.0001
XML
Image XML parsing0.00200.206750.0004
class_abstraction
Instantiating content class attribute0.00000.0020110.0000
General
dbfile0.00120.1236220.0001
String conversion0.00000.001240.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
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
10content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
19content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/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: 46
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs