Files preset disable uploads

Hi,

I can’t figure out how to disable uploads within the Files preset.

(Generally, where to find all the presets options? the documentation is very short on that topic)

Cheers!

The files preset doesn’t have many options:

  • headline
  • template
  • layout

is all there is

For more control, I’d use a files section instead of the preset, but there is no upload: false option, you can only set a max value.

As an alternative, you could hide the upload button via a custom Panel stylesheet and the Panel View Extended plugin (to be able to limit your styles to a particular page set).

Another option would be to use my new K3-filesdisplay-section, based on the Pagesdisplay section by @rasteiner

1 Like

Thanks, I’ll take a look at your plugin : )

The plugin seems to be outdated:
The `Toolkit\Query` class has been deprecated and will be removed in a future version. Use `Query\Query` instead: Kirby\Query\Query::factory($query)->resolve($data).

As a workaround, I successfully tried max: 1 together with these styles in custom panel.css:

/* 
    panel.css to fake "upload: false"
    sections:
      foo_no_upload:
        type: files
        max: 1
*/
section[class*="no_upload"] header.k-section-header,
section[class*="no_upload"] button.k-empty
{
    display: none;
}
section[class*="no_upload"] div.k-collection[data-invalid="true"] {
    border-style: none;
    box-shadow: none;
}

This works because the sections get a class name just like in the blueprint. Here, it ends with no_upload.

:face_with_diagonal_mouth: What’s so difficult about disabling uploads for file sections, though?

Nothing…

I’m going to update the plugin asap.

All right. Please take care that composer will not complain about stability requirements any more when using the composer.json that comes with the starter kit.

You see, I am currently having a bit of a frustrating re-start experience here. Since it’s supposed to be a “simple file-based” system, I was expecting that handling content files would still be … well … simple. Instead, every turn I take leads to some kind of road block.

Background is: An old installation that uses manually uploaded files without any matching .txt files. So I now decided to go with a universal default.yml to handle that. Btw: it should be called blueprint instead of template because it lives in blueprints and does not serve as a page template. And first thing I fixed myself a “listed/unlisted” toggle, because that does not exist natively for files, either. One more thing: I would appreciate a native Owner role/permission/option for both pages and files. Thanks :wink:

If you have feature requests, please post them on https://feedback.getkirby.com where we collect such things.