Get datePublished for article

Hi,

is it possible to get the date when an article (blog-post) has been published? If not, is it possible to write the date into a field automatically, when the article is published?

You can use a hook that sets the date when you change the status of the page, in particular, this would be the page.changeStatus:after hook

Inside your hook, when the status is listed, update the page with the current date using $page->update():

Works great, thanks a lot :smile: