Custom Section Pages Create Dialog

I have created a custom panel section, that lists pages as tree with children as table and want to add the create page button with the page create dialog:

<k-section 
        label=""
    >
        <k-button 
            icon="add" 
            size="xs" 
            slot="options" 
            variant="filled"
            @click="$dialog('pages/create?parent=pages/business&view=pages/business')"
        >
            Hinzufügen
        </k-button>
...

The dialog opens in a default mode:

The dialog I get and want when I use a normal pages section:

I`m aware that the dialog has to load some props in order to show my desired fields, question is, what do I have to do to define the dialog in my custom section to do just that, without doing hard coded stuff and react to in the page blueprint defined create fields?

Hey,
maybe this will be all you need. The create dialog option (page blueprints) allow aditional fields to the dialog.

Thanks David, but this only works in the standard Page Section, but not when I use a custom Vue Component for my own created section

oh, ok. i did not know that. i just made a menu entry with a create dialog an in this case the blueprint options are working.

@PatrickFox Do you have a normal pages section in your blueprint that correspond to the options you need and your customs section is only in addition to that (meaning the dialog could just use the default pages section dialog)? Or shall your custom section stand fully on its own (meaning it would have to implement the dialog handling itself)?

Maybe either way the PageCreateDialog class needs not just parent and view as query parameters, but also the name of the section as section. Try adding this and let’s see how far that gets you.

My assumption is that your custom section also needs to implement the blueprints method on the section for the template select to show kirby/config/sections/pages.php at main · getkirby/kirby · GitHub.

Added the view and section parameters to the dialog call and added the methods for the blueprint and now it works as expected - thanks! :star_struck: