kirby-template-hooks icon indicating copy to clipboard operation
kirby-template-hooks copied to clipboard

Optional input parameter for file update

Open thomasjonas opened this issue 2 years ago • 3 comments

Should fix #7 Maybe parameters for functions should also be optional, but I'm not sure if they cause any problems.

thomasjonas avatar Aug 10 '23 18:08 thomasjonas

I need to check again. Because seems that's correct according to the document: https://getkirby.com/docs/reference/plugins/hooks/file-update-before

afbora avatar Aug 10 '23 18:08 afbora

Yeah, I saw that as well. So I was a bit surprised. Maybe it has something to do with the fact I'm using a custom file blueprint.

Page blueprint

title: Default

fields:
  content:
    type: layout
    fieldsets:
      gallery:
        name: Sponsors
        icon: money
        preview: gallery
        fields:
          images:
            label: Sponsors
            type: files
            query: model.images
            multiple: true
            layout: cards
            size: tiny
            empty: No sponsors yet
            uploads:
              template: sponsor
            image:
              ratio: 1/1

/site/blueprints/files/sponsor.yml

title: Sponsor image

fields:
  link:
    type: url
  alt:
    label: Alternative Text
    type: text

accept:
  mime: image/*
  type: image

thomasjonas avatar Aug 10 '23 18:08 thomasjonas

Any chance of reproducing the problem?

thomasjonas avatar Aug 29 '23 13:08 thomasjonas