How does work embed.tpl override ?

Author Message

Pascal France

Saturday 08 July 2006 7:41:25 am

Hi,

I did an override of design/standard/templates/node/view/full.tpl but now related objects are no more shown.

So, I'm trying to understand how I can use the embed.tpl template (or an override).

By default, the design/plain/override/templates/embed/file.tpl override template is used in place of design/standard/templates/content/view/embed.tpl (see override.ini.append.php)

But I can't find any design/ template which includes embed.tpl

Which template calls/includes embed.tpl ?

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Pascal France

Saturday 08 July 2006 10:01:40 am

Hi,

Ok, I founded how to display related objects with my design/standard/templates/node/view/full.tpl override template.

But now, how can I display an object icon depending the related file extension ?
For example, I would like to display a PDF icon before the related file name if it is a PDF file, or a JPG icon if it is a .jpg file and so on ?

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Kristof Coomans

Monday 10 July 2006 1:59:04 am

Hello Pascal

Use something like

{$fileAttribute.content.mime_type|mimetype_icon('small',$fileAttribute.content.original_filename)}

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Pascal France

Monday 10 July 2006 3:24:05 am

Hi Kristof,

Related to your answer, I found this page:
http://ez.no/doc/ez_publish/technical_manual/3_7/reference/template_operators/miscellaneous/mimetype_icon

But could you tell me what is the $fileAttribute ?
Where does it come from ? and/or what does it contains ?

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Pascal France

Monday 10 July 2006 6:49:15 am

Well...,

Now, to display the article related objects I use (in my article template):

{section show=$node.object.data_map.image.content.is_empty|not}
{attribute_view_gui attribute=$node.object.data_map.image}
{/section}

where "image" is the related object datatype identifier.
This code display the Name of the related file, the real name of the uploaded file and its size.
But I don't control the display of these informations.

In my database I found the "binaryfile" table which contains:

contentobject_attribute_id  5558
download_count    0
filename     db2ba3f72b6de829fc869b0ed30f3b6c.pdf
mime_type      application/pdf
original_filename     AU_Argentine_harcelement_10-avril-2006.pdf
version      1

I found the ezbinaryfile doc:
http://ez.no/doc/ez_publish/technical_manual/3_7/reference/objects/ezbinaryfile

How can I access these fields ?

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Xavier Dutoit

Wednesday 12 July 2006 11:41:28 pm

Hi,

Have a look at the template that displays the image attribute.

On debug mode, you can display the list of all the template used. Clear the template cache and run the page, so you'll know wich one is the template to look at (quite easy to loose track, when you override everything everywhere ;).

X+

http://www.sydesy.com

Pascal France

Thursday 13 July 2006 4:10:11 am

Hi,

In fact, it is not a good idea to use the Related object datatype. It is better to use the Related objects field which is displayed at the bottom of the object edit page.
We can then access all these attributs:
http://ez.no/doc/ez_publish/technical_manual/3_7/reference/objects/ezbinaryfile

But I have a trouble with "concat".

$my_related[1].data_map.file.content.filepath

gives me var/plain/storage/original/application/8c3d8498edb91c86d46c6170d564dc90.pdf

"/"|ezroot()

gives me http://www.linuxorable.net/ez_publish/

So, why this code:

href={concat("/"|ezroot(),$my_related[1].data_map.file.content.filepath)}

doesn't give
http://www.linuxorable.net/ez_publish/var/plain/storage/original/application/8c3d8498edb91c86d46c6170d564dc90.pdf

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Pascal France

Thursday 13 July 2006 4:17:15 am

Hi,

href={$my_related[1].data_map.file.content.filepath|ezroot()}

works fine.

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.