Have a look here.
This is the form that is shown right now.
To add a new field you can actually use the same syntax as any blueprint field. Only that it is not written in yml but in php.
Example for a date field
<?php
$form = new Kirby\Panel\Form(array(
'title' => array(
'label' => 'pages.add.title.label',
'type' => 'title',
'placeholder' => 'pages.add.title.placeholder',
'autocomplete' => false,
'autofocus' => true,
'required' => true
),
'uid' => array(
'label' => 'pages.add.url.label',
'type' => 'text',
'icon' => 'chain',
'autocomplete' => false,
'required' => true,
),
'date' => array(
'label' => 'Date',
'type' => 'date',
'format' => 'MM/DD/YY',
'default' => 'today',
'required' => true,
),
'template' => array(
'label' => 'pages.add.template.label',
'type' => 'select',
'options' => $options,
'default' => key($options),
'required' => true,
'readonly' => count($options) == 1 ? true : false,
'icon' => count($options) == 1 ? $page->blueprint()->pages()->template()->first()->icon() : 'chevron-down',
)
));
The controller should look something like this.
$form = panel()->form(__DIR__ . DS . 'form.php', $parent, function($form) use($parent, $controller) {
try {
$form->validate();
if(!$form->isValid()) {
throw new Exception(l('pages.add.error.template'));
}
$data = $form->serialize();
$page = $parent->children()->create($data['uid'], $data['template'], array(
'title' => $data['title'],
'date' => $data['date'], // this is what changed
));
$controller->notify(':)');
$controller->redirect($page, 'edit');
} catch(Exception $e) {
$form->alert($e->getMessage());
}
});
I only took the parts of the code here that are important for the functionality.