Announcement

  •  » Themes
  •  » Display the creation date on album overview page

#1 2018-07-22 15:52:34

adastra
Member
2018-07-22
8

Display the creation date on album overview page

Hello everyone,

I would like to display the *creation date (M/Y) * of the *most recently added photo* of an album on the album overview page (homepage). So for example if I have an album in which there are a lot of photos taken in September 2016 with the most recent being September 21st, 2016, I would like to display the text "September 2016" below the album name.

(How) is this possible?

Furthermore, is there a website with an overview of all the template tags (e.g. {$cat.DESCRIPTION})? I couldn't find any on here yet..

Piwigo version: 2.9.4
PHP version: 5.5.38
MySQL version: 5.7.21

Offline

 

#2 2018-07-22 17:43:38

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: Display the creation date on album overview page

Hi adastra,

In your local configuration (you can modify it with plugin LocalFiles Editor), add:

Code:

<?php
$conf['display_fromto'] = true;
?>

Depending on your theme, it "may" work :-)

Offline

 

#3 2018-07-22 18:01:55

adastra
Member
2018-07-22
8

Re: Display the creation date on album overview page

Thanks! But how do I add it to my template now?

Offline

 

#4 2018-07-22 18:44:39

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13789

Re: Display the creation date on album overview page

If nothing happens on your gallery, it means your theme is not compatible :-/ If you want to modify the templates of your theme, check how it's implemented on the "default" theme, template mainpage_categories.tpl :

Code:

        {if isset($cat.INFO_DATES) }
        <p class="dates">{$cat.INFO_DATES}</p>
        {/if}

Offline

 

#5 2018-07-22 19:15:30

adastra
Member
2018-07-22
8

Re: Display the creation date on album overview page

That did the trick, thanks! :)

However, currently it display a text like this: "from Tuesday 29 September to Monday 5 October 2015"

How can i display it only the month and year of the latest photo, so e.g. "October 2015"? Or how can I customize it in general, e.g. making it show "29 Sep - 5 Oct 2015"?

Also, it's not displayed on albums with sub-albums, any way to add it there?

Last edited by adastra (2018-07-22 19:18:04)

Offline

 
  •  » Themes
  •  » Display the creation date on album overview page

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact