Open cgundermann opened 4 years ago
If you need a workaround for the time being, you could assign a template to the files via a file.upload.after
hook.
Thanks for the suggestion, @texnixe,
this means, on the frontend, I can't filter by the template anymore, if I wanted to skip the cover
file, right?
foreach($page->files()->filterBy('template', 'default') as $file):
...
I would have to add an additional field in the file blueprint:
# files/cover
extraFilterField: cover
# files/default
extraFilterField: default
and then on the frontend:
foreach($page->files()->filterBy('extraFilterField', 'default') as $file):
...
Files section, according to the Docs: property: template, Description: Filters all files by template and also sets the template, which will be used for all uploads
Here's an example of a files field with the following select & upload options:
and a files section on the same page:
this section displays all files of the page, allowing me to edit / delete individual files with any template (incl.
cover
),but when uploading via this section, no template will be assigned to the file.
Now the following setting
will assign a
default
template to the uploaded file, but won't display files with other templates assigned, which makes it impossible to edit / delete a file with the templatecover
from this section. I would need an extra files section for that.I think, a files section with separate
template
andupload
options (similar to a files field) could avoid having unnecessary extra files sections just for the purpose of editing / deleting files with various assigned templates.Or did I miss a solution to my problem? 🤔