Is it possible to add default values to fields like title, url appendix /slug, date (like: next sunday) and such, so that the fields in the dialog are pre-filled? I tried a few things in the blueprint, but they didn’t work. See example with default for title below.
default: Wochenrückblick KW/2023
published is a datefield, not sure if i can use anything like “next sunday” in here.
label: Published on
default: now + 1 day
Anyway, the field shows up in the dialog but it’s empty. Would be awesome if it was prefilled.
I also need to correct my previous comment:
I thought it was possible to use queries for default values, but it does not seem to work anywhere. For comparison queries do work in the help text but not for default. Would be super useful if we could use queries so it can be based on something the user previously has entered.
If this is something that is not on the roadmap, is their any way of manipulating the default values before the dialog is displayed, with a custom model, hook or something…? @texnixe
The update is nice, but i think this still doesn’t work for me, cause i can’t see a way to get the date and calendarweek of “next sunday” which i need in the slug and title. I built a workaround that is okay for me: a new template that does all stuff (get the date of next sunday and such) and creates a new page in the place where it should be and with all the defaults i need. The template is assigned to a hidden page i open from the panel. Adding a button to do so could be done to save 1 or 2 clicks but it was too much overload for such a simple task imho.
Might be possible if you create the blueprint via PHP, but only if the parent page is known, because in programmable blueprints you don’t have access to the current page.
Ok this is interesting… I’ve never done blueprints this way, let’s see if I have time to test. But… I need to fetch the date of a sibling “event” page, do some work with that, and use as default for the page being created. The parent page is a “tour” page and there are multiple. So I guess it won’t work?