For some websites, it makes sense for the visitor to know how old the displayed content is and therefore whether it is still up to date. The display of the last modification date (at least for content of type tt_content) can easily be inserted for this purpose. On the other hand, it is often desired to suppress the date for very old posts - after all, it could be an indication that the web content is not up to date and not maintained.
With the TypoScript code presented here, the date of the last change is displayed - but only if it was not more than one year ago. The time period can be easily adjusted using the formula:
temp.calculation = TEXT
temp.calculation.dataWrap = {date:U} - {page:SYS_LASTCHANGED}
temp.ageInSeconds = TEXT
temp.ageInSeconds {
cObject < temp.calculation
prioriCalc = 1
}
temp.updated = TEXT
temp.updated {
value = 365*24*60*60
prioriCalc = 1
}
temp.lastUpdated = COA_INT
temp.lastUpdated.10 < styles.content.lastUpdate
temp.lastUpdated.10.if {
value.cObject < temp.ageInSeconds
isGreaterThan.cObject < temp.updated
}
page.10.variables.LASTUPDATE < temp.lastUpdated.10This page contains automatically translated content.
Updated: 09.04.2025