image in article

Author Message

enigmista enigmista

Tuesday 09 September 2003 8:02:37 am

Hi i want isert image in my article and i have found this documentation about it: http://ez.no/developer/ez_publish_3/documentation/day_to_day_use/how_to_add_objects_to_an_article

When i do this procedure i see the link to object and not the object (image) in my article.Why? How can i display picture? Thanks a lot

laurent le cadet

Tuesday 09 September 2003 8:16:06 am

Hi,

I think you can see the image in the admin site but not in the public site.
You have to create a new template for your embeded image :

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

and declare it in the override.ini.append :

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

Laurent

enigmista enigmista

Wednesday 10 September 2003 3:05:08 am

I think that problem is this. But i have no results with this method. I have done this:

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

and saved it in design/mydesign/templates/content as embed_image.tpl

In override.ini i have putted this:

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

What is wrong?

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

Main resources:

Total runtime0.6796 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0084 588.9297152.6094
Module start 'layout' 0.00840.0029 741.539139.4141
Module start 'content' 0.01130.6668 780.9531543.0391
Module end 'content' 0.67810.0014 1,323.992212.1875
Script end 0.6795  1,336.1797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.5083160.0002
Check MTime0.00150.2198160.0001
Mysql Total
Database connection0.00170.243410.0017
Mysqli_queries0.595187.5657570.0104
Looping result0.00060.0906550.0000
Template Total0.639094.020.3195
Template load0.00170.255120.0009
Template processing0.637293.767220.3186
Template load and register function0.00020.034310.0002
states
state_id_array0.00230.345110.0023
state_identifier_array0.00220.316420.0011
Override
Cache load0.00160.24131290.0000
Sytem overhead
Fetch class attribute can translate value0.00070.104620.0004
Fetch class attribute name0.00280.408240.0007
XML
Image XML parsing0.00070.100120.0003
class_abstraction
Instantiating content class attribute0.00000.002040.0000
General
dbfile0.00090.1272160.0001
String conversion0.00000.001640.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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
22content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
19content/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: 47
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs