Showing Image in Intro or Body of Article!!!

Author Message

Leandro Alves

Monday 04 August 2003 12:25:34 pm

If I want to show an image in my page.tpl I use the following sintax:

<img src={"image.gif"|ezimage} width="700" height="67" border="0" />

If I put this above in my article (intro or body), it does not work...

In my admin page, I add a new image and I create a new article... After I put this in my new article using the Related objects:

<object id='135' /> (135 is my image id)

What Can I do to show an image directly in my article???
I do not the link of image, I want to show it!!!!

This is the best method???

Thanks!
Leandro

Robin Sørlie

Monday 04 August 2003 3:35:38 pm

Did you install the demo version?
You need to have an embed template in /yourdesign/override/templates/content/view/

If your image class is class 5 make a file called embed_class_5.tpl in /yourdesign/override/templates/content/view/ folder. In this file you must have following:

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

{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}

{switch match=$align}
{case match="left"}
<div class="imageleft">
<img src={$image_variation.full_path|ezroot} />

<div style="width: {$image_variation.width}px;">
{$object.data_map.caption.content.output.output_text}
</div>
</div>
{/case}
{case match="right"}
<div class="imageright">
<img src={$image_variation.full_path|ezroot} />

<div style="width: {$image_variation.width}px;">
{$object.data_map.caption.content.output.output_text}
</div>
</div>
{/case}
{case}
<div class="imagecenter">
<img src={$image_variation.full_path|ezroot} />

<div style="width: {$image_variation.width}px;">
{$object.data_map.caption.content.output.output_text}
</div>
</div>
{/case}
{/switch}

{/let}

BTW, what version do you have?

Leandro Alves

Tuesday 05 August 2003 10:11:02 am

Thanks a lot for your replay Robin...

I am using eZ 3.1 and a install the demo version.

There is a file in my /mydesign/override/templates/content/view/
called embed_class_5.tpl.

But the image does not show!

I will see what is happen with my templates...

Thanks again

Bjørn Kaarstein

Wednesday 06 August 2003 2:18:12 am

In your override.ini :

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

Copy the content of embed_class_5.tpl into imageobject.tpl, and place it in you override/templates folder...

Clear the cache.

Regards Bjørn

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

Main resources:

Total runtime1.4751 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 588.0469152.6406
Module start 'layout' 0.00840.0037 740.687539.4766
Module start 'content' 0.01201.4615 780.1641535.5703
Module end 'content' 1.47360.0015 1,315.734412.7500
Script end 1.4751  1,328.4844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.2472160.0002
Check MTime0.00130.0892160.0001
Mysql Total
Database connection0.00150.099210.0015
Mysqli_queries1.387394.0463620.0224
Looping result0.00080.0560600.0000
Template Total1.419296.220.7096
Template load0.00240.160420.0012
Template processing1.416996.049720.7084
Template load and register function0.00010.009010.0001
states
state_id_array0.00110.077810.0011
state_identifier_array0.00070.049620.0004
Override
Cache load0.00210.1406760.0000
Sytem overhead
Fetch class attribute can translate value0.00080.052830.0003
Fetch class attribute name0.00220.150140.0006
XML
Image XML parsing0.00040.028330.0001
class_abstraction
Instantiating content class attribute0.00000.002240.0000
General
dbfile0.01571.0644100.0016
String conversion0.00000.000740.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
12content/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: 33
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs