Skip +Add dialog possible?

When I click the +Add button on my page section, I get a small popup to put in the title and slug. Is there a way to skip this and go directly to the full page showing all the fields?

Sometimes I start writing and backfill the title later from what I have written, and this popup is a barrier to just start writing into the main text field.

1 Like

Not out of the box. Kirby needs to create the folder with a text file, so you would need a plugin that auto-creates pages with a random slug and title. Since in most cases you don’t want a random slug (you would have to change it later as well), I wonder if the time saved at page creation is really worth it. Also this would only make sense for pages section where the subpages can only have a single template.

1 Like

Thanks. That is the case in my project. Indeed there is only one template and the slug does not matter much (It is a list of issues, so the slug should ideally be an automatically generated integer that is increased when a page is generated.)

So I guess for me any slug would be ok, and the title could be empty until specified.

Maybe I’ll send this in as a feature request :slight_smile:

This would in fact be very useful for multiple use cases.

1 Like

Also have the same question, in my case page title and slug are auto generated, so no need in this step.

There is a plugin for this: https://github.com/steirico/kirby-plugin-custom-add-fields

Hi

I’m the author of kirby-plugin-custom-add-fields. I could implement the feature to skip the add dialog.

But as @texnixe mentioned this would implicate that either

Is there a demand for such a feature? If so, I’m willing to implement it.

I thought that was already possible.

But yes, there is definitely a demand for such a feature. Create a new page with a given template (blueprint option) and a random unique slug.

I think it would be a useful feature, however revealing more fields in the “Add” dialog might actually solve some of the use cases for me.

I’m unsure what this means in practice, so no idea if that would complicate things for my use case.

Ok, v1.2.0 implements this feature.

This is the relevant section in the readme:

5 Likes

Thank you!

Hi there,

I need help for skipping the +Add dialogue.

My use case: the website of a bar wants to announce concerts, so I added such blueprint/template/etc. with fields such as date, time, bands, some text, etc. It works as expected, just the +Add dialog is completely without value (and unfortunately confusing the bar owners).

Why without value? Simple: Each concert is uniquely defined by the fields date and bands, so no need for any additional title. Ideally, the title would be generated from date and bands fields, but any random title will be fine as well.

From what I read here, steirico/kirby-plugin-custom-add-fields plugin seems to be the one I shoudl use.

Unfortunately, I fail to understand what I need to do. I followed the short explanation from GitHub - steirico/kirby-plugin-custom-add-fields: Custom fields for Kirby's add dialog..

Now, an empty dialog pops up, when I click +Add. No fields to edit, and clicking “Create draft” give me an error message “Form is not valid”.

I added the code to my new file site/blueprints/event.yml and set the “forcedTemplate” field to “event” as well, which hold the template for my event. I did not change anything else.

Could anyone help me? Was my explanation clear enough?

Hi blubstar,

The problem about the empty dialog and the error message might be related to the used PHP version. Are you using PHP8?

As far as I understand your use case, I would propose a slightly different approach. Instead of skipping the Add Dialog, add the fields date and bands to it. So, when adding a new event, one has to enter date and band. Then the new page gets created with these information pre-filled. Furthermore, you could generate the title and slug out of these information by using a hook script.

1 Like

Hi steirico,

you are right, I am on PHP7 and appearently forgot to check the prerequisites – my bad, sorry!

Your suggestion is brilliant (and exactly what I did as a workaround in the meantime).

Thank you for the nice support.