I have an odd issue: When I upload a file using a default super basic files field, the default files blueprint is used, but only half way.
Given this field:
files:
type: files
I would assume, files uploaded here use the default
file blueprint. However, when I upload a file, the default blueprint is not assigned, but partially used, and partially ignored.
Given this /site/blueprints/files/default.yml
blueprint:
title:
*: file
options:
changeTemplate: true
fields:
info:
type: info
label:
*: info
text: Test
theme: none
The uploaded file looks like this in the panel:
I’ve highlighted three things in the image with numbered labels to illustrate my problem:
- The template (“Vorlage”) is empty, as the blueprint was not assigned to this file.
- The change template (“Vorlage ändern”) is disabled, despite that being explicitly enabled. Yes, there are other blueprints available that are compatible.
- The Info field from the blueprint is shown, proving Kirby is using the default files blueprint.
I must be doing something wrong, but I cannot figure it out. For completeness, here is the /site/blueprints/files/image.yml
file:
title:
de: Bild
en: Image
accept:
type: image
options:
changeTemplate: true
fields:
alt: fields/alt
Some tinkering to gather more info:
If I open the file’s sidecar .txt
file and edit it to use the image
blueprint, I get this:
The annotations this time show:
- The blueprint “Image” is being used. However, it’s not processed correctly. The blueprint has an English and a German title, but Kirby acts as if there was only an English title.
- I can now change the template (see below)
- The default blueprint’s “Info” has been replaced by the “image” blueprint’s Alt-text field, proving Kirby is using the blueprint.
When I click on change template, I get a dialog that uses the provided translations for the Image blueprint, and ignores the title provided in the Default blueprint:
Changing to the default template, shown here to have the name “-” (dash), brings me back to the state I was in before editing the sidecar file (see first image).
Help, I’m lost…!