Add caption to a file

Hi - I want to create a home page carousel gallery
for that I use the files field.
Now I upload files and it creates a nice gallery out of them. cool.

The problem is that I want to add a caption to each file in this gallery…
How can I achieve this? (I don’t want to edit the file blueprint because I use the files field serves in other pages and functions)
can I create a custom field, like the custom block?

I would appreciate any suggestions… !
thanks

You can use file blue prints

There you can use pretty all the same fields you do in a page blueprint.

Just noticed you are using file blueprints - can you give a little more info? Not sure why you cant use it in multiple places.

1 Like

You can create a different files blueprint specifically for the carousel and specify it in the blueprint for your carousel.

Thanks for the replies!
this is my home page yml file: home.yml

title: home

sections:
  gallery:
    type: fields
    fields:
      imgs:
        label: Images for home gallery
        type: files
        template: cover
        layout: cards
        image:
          cover: true
  projects:
    label: cases
    type: pages
    template: project

the imgs field in the gallery section is a files type. I want only for these files to add a caption.
I use the files field in a different page too - there I want the files to have a different blueprint - a bit more complex. so I dont want all the files in the websites to have the same blueprint.

So - I created a file called cover.yml inside: ‘site-blueprints-files-cover.yml’
this yml file looks like this:

title: cover

fields:
  caption:
  type: writer

but the file page in the panel still looks like this:

any idea what am I doing wrong?
I hope I am understood - thanks for the help!

On the files field on your other page you can set the name of the blueprint you want them to use

1 Like

That just means there isnt a default file blurprint it to fall back on.

1 Like

ok I got it now - I thought it didn’t work because I needed to delete the files and upload them again to see the changes.

It works now - Thank you for the help!

Yes - you can also open the text file for a file in a code editor if you are working locally and manually change the template key in there. Saves re-uploading.

1 Like