Thank you, Sonja. I didn’t get any further with this so turned to this hook:
'page.*:after' => [
function($newPage, $oldPage) {
if (in_array($newPage->intendedTemplate()->name(), ['events-list-group', 'events-list-single-item'])) {
$dateBegin = $newPage->date()->toDate('ymd');
// get value of date_end field
$dateEnd = $newPage->date_end()->toDate('ymd');
// construct slug
$slug = $dateBegin . "-" . $dateEnd . "-" . $newPage->title()->value();
//set slug according to add field title
$oldPage->changeSlug(Str::slug($slug));
}
}
]
which works fine, except after saving the page is not redirected to the new slug in the panel.
Is that something, that is now possible with the new Fiber feature? It tried adding Panel::go() at the end of my hook, but then get this error. The slug still gets updated, though.