[TYPO3-dev] Last updated: Page and Content

Bernd Wilke t3n at pi-phi.de
Wed Feb 24 14:45:56 CET 2016


Am 24.02.2016 um 14:23 schrieb Gion Koch:
> Hi fellow Devs,
>
> After trying several approaches and debugging, I have decided to ask you
> guys.
> I have to add a "last updated" date on every page. I saw a lot of
> threads about this specific feature.
> Almost any of the answers had a solution with the SYS_LASTCHANGED field
> from the pages table. I've implemented that, but realized, that this
> only counts for editing the page record, and not the content.
> The other approach was to use page:lastUpdate, but this show on every
> page the present date.
>
> Now, the next approach, which I am working on, includes a TS script
> doing a query on tt_content.
>
> Isn't there a more straightforward approach?

in general the problem is more complex:
if you use a plugin in your page which shows data records stored in 
another page. those records need to be included. and if those records 
are filtered this filter needs to be respected.

e.g. you have a plugin on your page which shows news which have the 
category 'country 1'.
so any changes to news which does not have the category 'country 1' are 
irrelevant, but also hiding one news with this category may (or may not) 
alter the content of this page. if you show only the latest 10 news of 
that category a change at record 11 would not change the content of this 
page. hiding record 7 will result in another records visible but all 
visible records were changed much earlier than the hiding.

so the last change of a page is difficult to compute.

which value to show?
1. last change to the page-record
2. last change to (page or )any tt_content record on that page
3. last change to (page, tt_content or) news record?

and don't forget: the same as for news records:
you may have multiple languages on one page: changing one english 
content does not modify the german or french page-variant.

you may understand that there could not be a simple function to compute 
'the last change'.

you may hook into the function to store records, but you need to build a 
lot of dependencies to update the last-changed field of each page correctly.

bernd



More information about the TYPO3-dev mailing list