embeded image: show thumbnail

Author Message

Thomas Brandl

Friday 05 September 2003 1:43:59 am

Hi,

I am trying to show the thumbnail of an image, which I added to an infopage as related object.
Therefor I overrided /content/view/embed.tpl with a template, that is supposed to display the thumbnails source (<img src...>)

However, I can not find any information within this object that points me to the thumbnails source!
According to the admin interface, the thumbnail is stored in:
/var/storage/variations/image/p/h/p/phpkBI2jg_100x100_138.jpg

This is the source I need!

I feel, it's not intended to make use of the thumnail outside the admin interface, right?

Thanks for hints!

Thomas Brandl

Friday 05 September 2003 1:53:09 am

ok,
{attribute_view_gui image_class=small attribute=$object.data_map.image}

does the trick. It's just not very intuitive for me yet..

laurent le cadet

Friday 05 September 2003 1:53:24 am

Maybe you can try :

<object id="1" size="small" />

(change 1 with your object ID)

Laurent

Thomas Brandl

Friday 05 September 2003 2:03:56 am

> <object id="1" size="small" />
> (change 1 with your object ID)

would be even better! Unfourtunately it's not working...

Is there a way to add attributes to the object tag (like size or alignment) that I can access from a template or pass to the datatype template (in this case ezimage.tpl)?

laurent le cadet

Friday 05 September 2003 2:29:47 am

did you override image.tpl with an embed_image.tpl ?

Thomas Brandl

Friday 05 September 2003 3:54:28 am

I overrided "/content/view/embed.tpl with a template, that is supposed to display the thumbnails source (<img src...)":

{default attribute_parameters=array()}
<a href={concat('content/view/full/',$object.main_node_id)|ezurl}>{attribute_view_gui attribute=$object.data_map.image}</a>
{/default}

The question is, when embedding related objects with <object id="xy" />, can I add additional attributes such as <object id="xy" myattribute="some_data" /> and access them in the template via e.g: {$object.data_map.myattribute}??

laurent le cadet

Friday 05 September 2003 4:09:56 am

I don't know if you can create extra attibutes.
really sorry.

Laurent.

Paul Borgermans

Friday 05 September 2003 5:15:37 am

You can pass attributes in the {attribute_view_gui ... myvar=myvalue}

In your template, you can access them as {$myvar}.

For <object id links> you may define a class and use this to select another template. This may also solve your problem.

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

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 22:30:28
Script start
Timing: Jan 18 2025 22:30:28
Module start 'layout'
Timing: Jan 18 2025 22:30:28
Module start 'content'
Timing: Jan 18 2025 22:30:30
Module end 'content'
Timing: Jan 18 2025 22:30:30
Script end

Main resources:

Total runtime1.5647 sec
Peak memory usage4,096.0000 KB
Database Queries74

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0083 587.9141152.6250
Module start 'layout' 0.00830.0045 740.539139.4453
Module start 'content' 0.01291.5504 779.9844634.0313
Module end 'content' 1.56320.0014 1,414.015616.1641
Script end 1.5647  1,430.1797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2216160.0002
Check MTime0.00130.0858160.0001
Mysql Total
Database connection0.00130.083310.0013
Mysqli_queries1.492995.4104740.0202
Looping result0.00070.0477720.0000
Template Total1.522697.320.7613
Template load0.00240.150320.0012
Template processing1.520297.156720.7601
Template load and register function0.00020.013710.0002
states
state_id_array0.00120.074510.0012
state_identifier_array0.00180.117120.0009
Override
Cache load0.00200.1277470.0000
Sytem overhead
Fetch class attribute can translate value0.00070.046130.0002
Fetch class attribute name0.00130.0800100.0001
XML
Image XML parsing0.00120.076730.0004
class_abstraction
Instantiating content class attribute0.00000.0015120.0000
General
dbfile0.00090.0597230.0000
String conversion0.00000.000540.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
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/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: 31
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs