So, this works as a rough attempt, but it is by no means finished and I am hung up on the difficult bit of using a hook to set the default values.
questions:
type: structure
label: Questions
help: These questions were randomly selected.
default:
- question: page://szuomtcdwzistlyg
link: ../@/page/szuomtcdwzistlyg
- question: page://szuomtcdwzistlyg
link: ../@/page/szuomtcdwzistlyg
fields:
question:
type: link
link:
type: url
label: Link to the question
This works and gives me a structure field with the values pre set. However, I read that the page.create:before hook does not let you change the content of the page. If I were to use the page.create:after hooks then I would not have to work with default values, right?
There is also an older forum post that explains how to overwrite the create method defined the blueprint by a function in the page model. For me that throws an error exception:
Declaration of ExamineePage::create(array $props) must be compatible with Kirby\Cms\Page::create(array $props): Kirby\Cms\Page
all I did was create a function in the page model of the intended page that was to be created:
public static function create(array $props)
{
return parent::create($props);
}
I am stumped and do not currently know how to approach a solution for this. ![]()