Forums / Setup & design / Files' published date indication

Files' published date indication

Author Message

Franck T.

Tuesday 02 May 2006 5:39:14 am

As asked in a previous topic, i'd like to remove the size indication in files view line. This is OK (thanks to Lukasz Serwatka) but now I fail adding the published date.
Here is my override of design/standard/templates/content/datatype/view/ezbinaryfile.tpl :

{section show=$attribute.content}
<a href={concat( 'content/download/', $attribute.contentobject_id, '/', $attribute.id, '/file/', $attribute.content.original_filename|urlencode)|ezurl}>{$attribute.content.original_filename|wash( xhtml )}</a>&nbsp;( {$node.object.published|l10n('shortdatetime')} )
{/section}

Let me say I way surprised to see that there was no date/time attribute for file objects (see http://ez.no/doc/ez_publish/technical_manual/3_6/reference/objects/ezbinaryfile) .
It's why I use <i>{$node.object.published|l10n('shortdatetime')}</i> but it returns: <b>( 01/01/1970 1:00 am ) </b>.
Any idea ?

Pascal France

Tuesday 02 May 2006 10:55:55 am

Hi Franck,

I did the same thing about published date with:

{$node.object.published|datetime('custom', '%l %j %F à %Hh%i' )}

and I don't know why, but I had to remove l10n operator.

Regards

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

Franck T.

Wednesday 03 May 2006 12:04:32 am

Thanks Pascal, but it still returns the same date <b> 'Jeudi 1 Janvier à 01h00' </b> (french format) for <b>all</b> my files. As if the actual published date was ignored ...

Nabil Alimi

Wednesday 03 May 2006 2:54:41 am

Hi Franck,

Once "in" the override of your datatype, you no longer have <i>directly</i> access to the $node var.
Instead, you should use something like <b>{$attribute.object.published}</b> to get access to your object published date.

My blog : http://www.starnab.com/ezpublish / http://www.starnab.com/ / http://www.assiki-consulting.com
eZ Publish Freelance developper. Feel free to contact me +33 674 367 057
nabil at assiki d0t fr

Franck T.

Wednesday 03 May 2006 5:19:41 am

Thanks Nabil.
Now it works fine.

Sujit Sth

Tuesday 04 January 2011 8:18:39 pm

Hi,

For published date of an article:

{$node.object.published|l10n(date)}

for all other date format click link below:

http://blog.developeronhire.com/tag/published-date/

Thank you