register_hook('COMMON_PAGETPL_LOAD', 'BEFORE', $this, 'handle_new_slot', array()); } public function handle_new_slot(Doku_Event $event, $param) { $id = $event->data['id']; $page = MarkupPath::createMarkupFromId($id); if (!$page->isSlot()) { return; } try { $pathName = $page->getLastNameWithoutExtension(); } catch (ExceptionNotFound $e) { LogUtility::internalError("Should not happen as it's not the root", self::CANONICAL); return; } $pageHeaderPath = TemplateSlot::createFromPathName($pathName)->getDefaultSlotContentPath(); if (!FileSystems::exists($pageHeaderPath)) { return; } try { $event->data["tpl"] = FileSystems::getContent($pageHeaderPath); $event->data["doreplace"] = false; } catch (ExceptionNotFound $e) { // Should not happen LogUtility::error("Internal Error", self::CANONICAL, $e); } } }