Show date plus time in album view (theme = matrix)

whodah
whodah's picture

Joined: 2003-05-17
Posts: 96
Posted: Wed, 2007-12-12 07:43

Hello all,

When viewing pictures in a G2.2.3 install, the date is presented underneath each thumbnail using the Matrix theme.

I'd love to be able to show the time as well.

I'm guessing this is a slight theme mod of the album.tpl perhaps?

I see the variable showDate in that file. And I see the variable showTime referenced in other non-matrix files.

I tried just setting:
showTime=true

beneath the showDate variable, saved the file, emptied out my template cache, reloaded the album, but no luck.

Is there a quick way to show the time beneath each thumbnail next to the date?
:)

Thanks,
-Who Dah?

9 x G1
4 x G2

 
jasher

Joined: 2007-12-10
Posts: 2
Posted: Sat, 2007-12-15 16:20

I know there are separate fields in the Admin/General Settings page for date, time, and date/time, but the quick and dirty way of doing it would be to change the Date Field settings to one that shows both date and time. Just above those fields is a link to php.net that shows you the different commands you could use, and what the resulting presentation would be. For instance, "%c" would show both date and time for a users locale. You can make the change to the field, save the changes, and just to the right of the changed field you'll see an example of the new date/time format that would be presented on your site. You don't have to clear cache, reload, etc to see what the format will look like.

In this way no edits are necessary to your template files. However I believe this change is global in nature and would affect all calls to the date request throughout the gallery. It worked for me when a client wanted to show just the year under her thumbnails.

 
whodah
whodah's picture

Joined: 2003-05-17
Posts: 96
Posted: Sat, 2007-12-15 18:00

That is awesome, and works great for my needs. Thanks jasher! :D

9 x G1
5 x G2

 
mormax

Joined: 2010-04-11
Posts: 2
Posted: Sun, 2010-04-11 20:26
jasher wrote:
In this way no edits are necessary to your template files. However I believe this change is global in nature and would affect all calls to the date request throughout the gallery. It worked for me when a client wanted to show just the year under her thumbnails.

I've spent some hours to find the way how to display date+time only in item view - if somebody is interested here's the solution:

Template to change is:
modules/core/templates/blocks/ItemInfo.tpl
In line 8 add the text in bold:
{capture name=childTimestamp}{g->date timestamp=$item.originationTimestamp style="datetime"}{/capture}