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

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

eZ debug

Timing: Jan 31 2025 00:17:41
Script start
Timing: Jan 31 2025 00:17:41
Module start 'content'
Timing: Jan 31 2025 00:17:41
Module end 'content'
Timing: Jan 31 2025 00:17:41
Script end

Main resources:

Total runtime0.1837 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.0625370.2734
Module start 'content' 0.00590.0182 958.33591,005.4688
Module end 'content' 0.02410.1596 1,963.80473,894.5391
Script end 0.1836  5,858.3438 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00422.2913200.0002
Check MTime0.00120.6724200.0001
Mysql Total
Database connection0.00050.296710.0005
Mysqli_queries0.087047.36901410.0006
Looping result0.00090.51491390.0000
Template Total0.159286.710.1592
Template load0.00080.446910.0008
Template processing0.158486.223410.1584
Override
Cache load0.00050.284110.0005
Sytem overhead
Fetch class attribute can translate value0.00170.906910.0017
XML
Image XML parsing0.00030.185610.0003
General
dbfile0.01156.2651200.0006
String conversion0.00000.002130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs