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:after
hook to rename uploads, but it affects all uploads, and I need it scoped tofish_cover_image
only.
What I Need:
- In the upload dialog, the “Filename” input should default to
{{ page.slug() }}
only when uploading a file with thefish_cover_image
blueprint.
Attempts So Far:
file.create:after
hook
– Works, but is too global (runs on every upload).- Blueprint
default
setting
– Kirby currently ignores anydefault
setting 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?