File block template

Permalink Browser Info Environment
Hello again.

I will update some of the files on my site on a regular basis and I will do that by using the replace function in file manager (practically adding a version of that file) in order to maintain a history for that file..
The Pixel templates for File block show the date of the original file (1st version).
<i class='fa fa-calendar'></i> <?php echo Core::make('helper/date')->formatDate($f->getDateAdded()) ?>;

Is there any way to show the date of the version in use (usually the last version)?

Thanks.

Type: Discussion
Status: Resolved
cristi78
View Replies:
shahroq replied on at Permalink Reply
shahroq
Hi,
You can replace $f with $f->getRecentVersion() in your template:
echo Core::make('helper/date')->formatDateTime($f->getDateAdded())

to
echo Core::make('helper/date')->formatDateTime($f->getRecentVersion()->getDateAdded());
cristi78 replied on at Permalink Reply
cristi78
Perfect!
Thanks.

concrete5 Environment Information

-

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You may not request a refund that is not currently owned by you.