Get the timestamp of last modification of TYPO3 page, difference between tstamp and SYS_LASTCHANGED
Asked Answered
M

3

7

What is the right way to get the date of last modification of a TYPO3 page (and its *tt_content*) ?

There are 2 fields in properties of table pages : tstamp and SYS_LASTCHANGED.

In this article SYS_LASTCHANGED are recommended. But what is the role of tstamp in this case ?

Which one should we use ?

Medrano answered 26/2, 2013 at 9:44 Comment(0)
M
6

tstamp is modification time of the page record itself. SYS_LASTCHANGED is the modification time of the page OR its content. It's updated once the page is rendered in the frontend, not right after the change in the backend. However, thanks to this it also includes changes of content records residing on a different page and inserted into the given page using "Insert Records" content elements.

Note: Tested in TYPO3 4.5 LTS and might not work in later versions.

Malachi answered 26/2, 2013 at 10:52 Comment(9)
After a bit of experimenting I changed my mind a couple of times about this.Malachi
tstamp is not the modification time of the page, but not of its content. I guess you missed to update your first sentence :)Haley
@maholtz: That's what I originally thought but on my experimental installation of TYPO3 4.5.22, modification of a content record updates tstamp of the page record as well. I'm a bit surprised myself because up until this question I thought that a page's tstamp is modified only when the page record itself is modified.Malachi
@maholtz: Mystery solved. It's dd_googlesitemap extension that adds this behavior. You are right then. I'm gonna change my answer.Malachi
kudos to you for this investigation!Haley
Thanks for the explanation ! I had dd_googlesitemap enabled, so it was also som strange for me. There is something strange : not all pages has SYS_LASTCHANGED filled, somtimes it's 0, sometimes the value is less than tstamp, probably another extensions makes such impact. Need to disable all, probably, to test on a blank TYPO3 installation.Medrano
@Fedir: If those pages are really displayble in the frontend (= not sysfolders), were displayed after a content change and the SYS_LASTCHANGED haven't changed, then it's strange. Consider whether you really need to check for page changes. On one of the sites that I built and that has a list of updated pages I check only for content change because I find the changes to the page records not relevant enough to consider the page updated.Malachi
is that still relevant in TYPO3 10? When I am using SYS_LASTCHANGED it get's updated only when page record is modified - I would like to display date when page or it's content has been modified.Caryloncaryn
@Caryloncaryn I'm not using TYPO3 anymore so I cannot tell but the answer is 7 years old. I believe I posted it for version 4.5 LTS so there is a very good chance it is not applicable anymore.Malachi
V
1

The field SYS_LASTCHANGED is only updated in the frontend once the page has been rendered.

  • Check lastmod in sitemap
  • Edit content element on page
  • Call page in frontend
  • Check sitemap again
Venegas answered 18/1, 2022 at 21:49 Comment(0)
A
0

tstamp is the date and time of the last change of the data stored in the pages table. It gets updated only when the page properties are changed, not the content of the page.

SYS_LASTCHANGED is often called as the real last update of the page including its contents but that seems not to be true at all and is not trustworthy. I can't tell what exactly triggers it's change but it seems to be related to the pages rendering. Even more strange is that it could be 0 on already rendered pages. My advice is to never rely on SYS_LASTCHANGED.

Our way to get the last change of a page displayed is currently as follows:
We added <time date-current="{data.tstamp}"><time> to our custom Contents/Partials/Header/All.html (you need to overwrite the fluid-styled-content-elements) and to our page template. Then a java script does the job to find out the latest change and inserts the html to the page, displaying the last change.

Alisealisen answered 17/11, 2020 at 19:25 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.