album date heritance

Hi,

I use in album.php the function

printAlbumDate('', '%d/%m/%Y'); 

to display its date. Fine.
But, when an album contains only sub albums, even with their date defined, date of parent album is null. It is not logical.
Is there a way to have the parent album date set to latest or oldest date of child albums automatically?

Thanks

Comments

  • acrylian Administrator, Developer
    edited November 2019

    The album date really is for the album itself and static as for all other items as well, meaning it is never updated unless you do manually. You could do that using the object model and a plugin. But what you probably are looking for is the "updateddate" which in 1.5.5 is updated for parents. The db field is called "lastchange", you can get it via the album class $albumobj->get('lastchange'); which you have to date format afterwards.

  • Hi Acrylian,

    Thanks for your reply.

    lastchange date is not exactly what I am looking for as I search for child dates of my sub albums (oldest or earliest), which is very different. But it works and it is better than nothing.

    AFAIK it seems that the album date looks dynamic as it is set from child images, right? It it is the case, an album could possibly use the same mechnism in cascade to read it from subalbums instead of images?

    BR

  • acrylian Administrator, Developer
    edited November 2019

    AFAIK it seems that the album date looks dynamic as it is set from child images, right?

    It is actually an option if you want to use the latest image date for the album date.

    I don't think there should be an automatic update of the date as you might find it useful and others confusing. The date is the "publish date" of an album generally and therefore independend on sub albums. This is why there is the "lastchange" date which reflects all sub levels and also images but of course only their "lastchange" as well.

Sign In or Register to comment.