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.