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

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 30 2025 00:15:35
Script start
Timing: Jan 30 2025 00:15:35
Module start 'layout'
Timing: Jan 30 2025 00:15:35
Module start 'content'
Timing: Jan 30 2025 00:15:35
Module end 'content'
Timing: Jan 30 2025 00:15:35
Script end

Main resources:

Total runtime0.0162 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 588.1406151.2109
Module start 'layout' 0.00620.0025 739.351636.6641
Module start 'content' 0.00870.0060 776.015694.2813
Module end 'content' 0.01470.0015 870.296937.9922
Script end 0.0162  908.2891 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002414.5530140.0002
Check MTime0.00116.6682140.0001
Mysql Total
Database connection0.00127.534010.0012
Mysqli_queries0.002414.752630.0008
Looping result0.00000.086610.0000
Template Total0.00127.210.0012
Template load0.00095.268310.0009
Template processing0.00031.940010.0003
Override
Cache load0.00063.403110.0006
General
dbfile0.001710.295880.0002
String conversion0.00000.041140.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs