Hello,
first of all, this is the current setup for context:
Every file uploaded is stored in /content and not in the respective page folders.
I created a Filemanager plugin that enables the user to create/remove folders (not real folders in filesystem, just a list of folder-IDs).
Based on that, the user can assign each file to a folder-ID and filter by it accordingly.
The folder-ID is set in the blueprint as a select field.
folder:
type: select
label: Ordner
options:
type: query
query: file.folders
text: "{{ item.name }}"
value: "{{ item.id }}"
I also extended the k-models-dialog to include a select-field for filtering by folder-ID (together with some visual changes):
I am stuck at the file fetching part. The source code fetches the items like so:
const response = await this.$api.get(this.endpoint, params);
My first attempt was to change the params such that it fetches all items at once ( {limit: 999}, setting pagination limit to a ridiculously high number) and filtering client-side. However that does not seem to work at all. The limit is always set to 20.
Another attempt was to create a custom api endpoint for fetching files, accepting a parameter: folderID and filtering server side.
This did work fine, but then i realized that the link field also uses the same models-dialog component. Which means, i cannot select a page, since the modal only shows media items.
So i have to somehow read the type of field. Also query definitions in blueprint such as site.images or site.videos do not work, because I am not reading the blueprint data (I don’t know how).
Is there any way i can achieve the desired result? Thanks