Disable files upload

https://getkirby.com/docs/reference/panel/fields/files#upload-options__prevent-uploading

Hello

I have an issue with “uploads: false” in the files section of my page blueprint. Here is my structure:

title: Marke

columns:
  main:
    width: 1/2
    sections:
      pages:
        label: Produkte
        type: pages
        layout: cards

  sidebar:
    width: 1/2
    sections:
      previewImage:
        label: Vorschaubild
        type: files
        uploads: false
        layout: cards

The user should only be able to select from the images that are uploaded to the children of this page … but I can’t figure out how. I think I misunterstood something in the documentation.

Thank you very much :smiley:

There is a difference between files sections and fields. The uploads: false options is avaialble on files fields, not sections.

The reference in the docuementation you qouted is for fields, not sections. You will need to switch your blueprint over so thati uses a files field rather then a section.

The main difference is that fieilds store content in the content files. Sections are for display / organising pages and files etc but they dont make any entries to the content files.

You can use the query language to make the field display images from the child pages.

For example -

query: page.children.images.

Its possible to ad a filter to that query if you dont want htings like PDFs to show as being selectable.

1 Like

Thanks @jimbobrjames

I just found the solution and wanted to delete my post but will leave it here, if there is anybody else with the same problem :smiley:

2 Likes