Customise "add Page" dialog - choose related page

Hello,

is it possible to customise “create new page” dialog? I would like to add a related page field. Preferably only when user selects a certain template.

The goal is to generate dynamic blueprint based on values from related page.

Can this be done Kirby way?

Thank you in advance

Kind regards
GDS

There is the “Custom Add fields” plugin:

It lets you define additional/other fields for the “Create page” dialog.

But it won’t help with dynamically creating blueprints, I’m afraid.

Thank you for the plugin tip! Your response time is out of this world :smiling_face_with_three_hearts:

Could you elaborate on the “it won’t help with dynamic blueprints” please.

Will I not be able to query the related page field in blueprint generator?

Which blueprint generator?

The blueprint of a page is assigned at page creation, so I don’t quite understand how you want to go about creating it dynamically.

Could you please elaborate a bit more what exactly you want to achieve, maybe there is a different way.

When creating a page a blueprint is assigned, but after the user inputs title and slug in a dialog, the content folder of that page is created and the panel is reloaded with inputs from the blueprint.

What I was hopping is, to dynamically generate the blueprint based on the related page the user selected when creating the page in question.

Will test it out and if it does not work as expected I have another idea:

Was thinking of creating a draft - and maybe even a blueprint, programmatically - when the owning side page is created with pre-filed values from that page.


Just to give you a picture of what I am trying to solve is:

We have event pages with undefined number of schedule entries e.g. talks (structure)

We also have recap pages where each recap relates to an event. When creating recap and selecting related event, the panel should preferably be pre-filed with data from the related event.

Thank you for the help!

The problem is that when you create blueprints dynamically, you don’t have access to the page itself, only to hardcoded pages or the kirbs and site objects (it says so in the recipe).

If you want to prefill data, that has not much to do with dynamic blueprints?

To prefill fields with content, you can use a page.create:after hook.

Thanks for the tip regarding page:create:hook, one issue is solved.

The other is to generate dynamic input fields based on the related page entries, but I believe you gave me some good pointers here.

Thank you