getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.31k stars 168 forks source link

[Panel] File fields: validation/notification on files section in page? #349

Closed SebastianEberlein closed 6 years ago

SebastianEberlein commented 6 years ago

The alt text for images is important for accessibility. That’s why in Kirby 2, I usually add a required text field for the alt text the next to the image field:

kirby-2

Of course, I could use a required file field for that. But when a user upload an image in the panel, they probably forget to click on the image after the upload to add the alt text in the file view.

Could there be a better solution in Kirby 3 with the new panel architecture and validating required file fields in the page blueprint?

Example from the Starterkit: In the file blueprint cover.yml, I set the "Alt Text" field to required: true. The page blueprint project.yml uses this file blueprint. So when I upload a cover image in the project page, the validation for this page also recognizes the required "Alt Text" field from the file blueprint:

Idea 1) Immediately after the user uploads an image, a dialogue is shown that requires the user to fill in the required file fields. But this can be annoying if the user uploads multiple images at once. Or if the file blueprint has multiple required fields.

Idea 2) Show an error text in the file field. It could work in the card layout, but maybe not the list layout…

validation

I’m not sure if there is a good solution that also works for every edge case. But it would be nice to have…

distantnative commented 6 years ago

Also check: https://github.com/k-next/kirby/issues/616

distantnative commented 6 years ago

@wottpal:

With Kirby & files I often had one problem: I upload a file into a page and forget to fill in required fields of the file. But this is no problem for Kirby and I can even save the page. So why not either

Disallow saving a page and display a form-error message like with required fields of the page itself or keep the current behavior but highlight the files with missing fields e.g. with a red outline

ghost commented 6 years ago

This issue was moved by bastianallgeier to k-next/ideas#86.