Forums / Setup & design / Showing Image in Intro or Body of Article!!!

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

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