Description:
I have created a custom file blueprint fish_cover_image.php that limits uploads to exactly 512 × 256 px images in webp/png/avif format. Now, I want the Kirby Panel’s upload dialog to pre-fill the “Filename” field with the page slug—but only for this one blueprint, not for every single file upload.
Current Behavior:
- Kirby prompts for a filename, defaulting to “image.jpg” or a random name.
- I already use a
file.create:afterhook to rename uploads, but it affects all uploads, and I need it scoped tofish_cover_imageonly.
What I Need:
- In the upload dialog, the “Filename” input should default to
{{ page.slug() }}only when uploading a file with thefish_cover_imageblueprint.
Attempts So Far:
file.create:afterhook
– Works, but is too global (runs on every upload).- Blueprint
defaultsetting
– Kirby currently ignores anydefaultsetting in file blueprints for the upload dialog.
Question:
How can I extend or override the page.file.create dialog in Kirby so that it pre-fills the filename with the page slug only for the fish_cover_image blueprint, without relying on a global hook?