I need to display a datetime field next to the title of the page on the tree list. I've used the following code in the ready.php file previously, but it's not working anymore. Also, I'm looking at displaying the date on the tree, not in the search.
Am I doing something wrong? Unfortunately I'm not familiar with hooks…
$wire->addHookBefore('ProcessPageSearchLive::execute', function(HookEvent $event) {
$event->wire()->addHookAfter('FieldtypePageTitle::wakeupValue', function(HookEvent $event) {
$page = $event->arguments(0);
if($page->template == 'event') {
$suffix = $page->datum;
$event->return .= ", {$suffix}";
}
});
});