File blueprints, ordering, and template access

I’m very confused about how these three things work. I wanted to have an alt text meta field for uploaded images. So I made an image.yml file and added it to site/blueprints/files/:

title: Image

accept:
  mime: image/jpeg, image/png, image/svg+xml, image/gif

fields:
  alt:
    label: Alt Text
    type: text
  caption:
    label: Caption
    type: textarea

Then I added this to the blueprint for the page where I wanted to use my new template:

sidebar:
  images:
    label: Work Images
    type: files
    template: image
    num: zero

type and template works. label has no effect—I just get “Images” no matter what I put there. And even though the files are sortable in the UI, I can’t figure out how to retrieve that sorting order in my page template, or even tell where that order is being saved (it’s not prefixing my filenames). But the UI remembers the order so I assume it’s being saved somewhere.

I’ve scoured the docs but I’m having trouble putting the pieces together.

  1. Sections don’t have a label but a headline
  2. There is no numoption
  3. Files are either sortable or not sortable. Sortable is true by default
  4. The sorting number is stored in the metadata file, as sort, you can then sort by this field in your template.
  5. It’s all in the docs: https://getkirby.com/docs/reference/panel/sections/files#options
2 Likes

I swear I saw that table multiple times and didn’t understand what I was looking at until now. I’m getting there… Thanks for your help @texnixe!