Hello there,
I got the problem, that the panels subpage builder is not calling the panel.page.create hook if it creates new subpages.
I created the following subpage builder:
pages:
build:
- title: Infobox
uid: event_info
num: 1
template: module.cardinfo_subpage
If the page creates the subpage my hook is not called. If I delete that created sub page and recreate it by hand, then the hook is called and works perfectly.
This is my hook:
<?php
kirby()->hook(['panel.page.create'], function($page) {
if($page->uid() == 'event-info') {
date_default_timezone_set("Europe/Berlin");
$today = date('l, d.m.y' , time());
$page->update(array('datepicker' => $today), 'yml');
}
});
I want to use that hook to set the current date as default value. This is really important because I want to make sure that the field can never be empty, even if it does not get filled in. Using default values via the blueprint is not the right way for my problem
Is it normal that hooks are not getting fired up when using the subpage builder?
Greetings