My usual files/default.yml looks like this:
title: File
fields:
poster:
label: Video Poster
type: files
query: file.page.images
focus:
label: Focuspoint
type: focus
width: 1/2
alt:
label: Alt Text
type: text
E.g. I mix up fields only needed for videos & images because it’s the simplest way to get the job done. It would be nicer to separate them but I don’t know of a simple way.
Dedicated file blueprints means that I need separate sections to upload them. I can’t mix videos and images with dedicated templates in one files section. Or am I doing this wrong?
You can use the ‘accept’ parameter to list the file types that your template applies to (https://getkirby.com/docs/reference/panel/blueprints/file#accept), so you can create a template that applies only to images, one that applies only to video, or one that applies to BOTH.
In each files section you can use the template option to determine which template will be used for each file within that section.
Judging from this only one template per files section is possible.
I have the same issue. It also doesn’t make sense to e.g. have a focus field on a document? I’ld like to have “default file template” for all files without specific set template (e.g. in a files field), but that can be extended by type. E.g. “default file blueprint” has an “alt” field, and a “default file - type image” has an extra focus field added to it.
That way, images that get uploaded via a textarea field can get the proper default templates.
blueprints/files/videos.yml
blueprints/files/images.yml
blueprints/files/documents.yml
I would love that.