Hallo,
Im trying to find a way to have a files field which would list all existing files within a pages folder. Similar to how the files filed in a page preset behaves, but with the ability to exclude unwanted files.
Files field
fields:
attachments:
type: files
query: page.files.not(page.header.toFile)
Using files field doesn’t show existing files within the folder. Files can be selected or uploaded, but that’s not what im aiming for.
Apart of that, newly uploaded files from textarea do not show up in that field.
Files preset
files:
preset: files
query: page.files.not(page.header.toFile)
Behaves exactly like files filed. Neither existing files nor newly uploaded files from textarea show up here.
Files section
Using files section seem not a right way either, since it doesn’t support querying
Page preset
title: Page
preset: page
pages: false
fields:
text:
label: Content
type: textarea
sidebar:
meta:
type: fields
fields:
date:
label: Publish Date
type: date
header:
label: Header Image
type: files
multiple: false
query: page.images
layout: cards
image:
cover: true
files:
query: page.files.not(page.header.toFile)
The files field works as expected. All existing files are shown and uploaded files from texarea are showing up in the list, however I can not filter the list in order to exclude unwanted items
Question
What is the way to have a list of files behaving as the files in page preset with the ability to filter the shown items?
Thank you in advance.
Kind regards
GDS