Since I had no idea where and how I should adapt something for my purposes, I experimented a little and found the solution.
(1) In the file site/plugins/custom-add-form/custom-add-form.php
you don’t have to enter the name of the template you want to use (= the name of the file in site/templates/) in line 13, but the name of the controller (= the name of the file in site/controllers/). In my case: blog
.
(2) In the file site/plugins/custom-add-form/form.php
I have defined how the default string should look like, which should also result in the folder name in the file system: $timestamp = "posting_".time();
(Note: I have noticed that URLs starting with a digit are a problem for kirby. The visible/invisible mode seems to react unclearly. Therefore, it is better to start them with a letter.)
(3) The variable $timestamp
is then inserted into the definition of the form in the file form.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,
'default' => $timestamp, // my modification
),
'uid' => array(
'label' => 'pages.add.url.label',
'type' => 'text',
'icon' => 'chain',
'autocomplete' => false,
'required' => true,
'default' => $timestamp, // my modification
),
'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',
)
));
If I create a new post now, the fields “Title” and “URL Attachment” (“URL-Anhang” in german) are filled with a dynamic text like “posting_1544808908” and I don’t have to worry about it anymore.
Thanks to @texnixe for the hint and @lukaskleinschmidt for the plugin! May this be helpful to all those like me who have no idea of controllers, hooks, templates and all the yaddayadda that others seem to take for granted.