Show file fields only for specific file types
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
_base
base
file-types.php
package.json
readme.md

readme.md

Kirby File Types

A little hack to show file fields only for specific file types.

Installation

To install the plugin, please put it in the site/plugins directory.
The plugin folder must be named file-types.

site/plugins/
    file-types/
        file-types.php
        ...

Blueprint

You can now use the fileType attribute in the field declarations.

# site/blueprints/fields/meta.yml

type: group
fields:

  label:
    label: Label
    type: text
    required: true
    fileType:
      - document
      - archive

  focus:
    label: Focus
    type: focus
    fileType: image