Good morning all,
Hope you’re fine ?
Is it possible to authorize the deletion of files present directly in the directories ?
The delete button only hide files from the Panel but the files still exist in directories…
Thank you !
You are using a files field, right? Then you are just removing the file entries from that field. It does not affect the files from the page.
You probably want to use a file section (Files section | Kirby CMS) with templating to structure your files per page. Then you can delete them right in the section.
Yes, here is my code sample :
title: Demande
icon: page
tabs:
demandes:
label: Votre demande
icon: text
fields:
author:
label: Contact
type: users
disabled: true
width: 2/3
event_type:
label: Asking for
type: select
width: 1/3
options:
- Event
- Meeting
- Conference
healineTwo:
label: Fichiers/documents obligatoires
type: headline
# Event files
file_event_presentation:
type: files
label: Event presentation
template: event_presentation
width: 2/4
when:
event_type: Event
file_event_program:
type: files
label: Event program
template: event_program
width: 2/4
when:
event_type: Event
file_event_budget:
type: files
label: Event budget
template: event_budget
width: 2/4
when:
event_type: Event
# Meeting files
file_meeting_presentation:
type: files
label: Meeting (presentation)
template: meeting_presentation
width: 2/4
when:
event_type: Meeting
If I understood correctly, it is mandatory to use a “section”?
I have an error when I put sections in tabs
It’s mandatory, if you want to be able to delete files directly, I guess.
What error are you getting?
Mabye sections need to be placed before fields…
Yeahh was that !!
Files deletion works well now !!!
Now have to mix with conditional sections !