Reference

File blueprint

Read the guide

File blueprints are located in /site/blueprints/files and control the Panel setup and form fields for individual file types.

In each files section you can use the template option to determine which template will be used for each file within that section. For example, you can create a files section to which users can only upload images and which have a given set of fields, and another section for PDF files with another set of fields.

Blueprint location

  • /site/blueprints/files

Default file blueprint

To create the same set of fields for all file types, you can setup a default.yml that is used whenever no custom file template is configured.

  • /site/blueprints/files/default.yml

Title

The title is required. It will appear in the file view to indicate the selected template for the current file.

title: Project Image

Translated titles

The title can be translated by passing an array of translations with the matching language code as key:

title:
    en: Project Image
    de: Projekt Bild

Accept

The accept option defines a set of rules which should be validated whenever a file with this type is created. This is perfect to allow only certain mime types, or check for the file size and the image dimensions.

The accept option can either be a simple string for a list of accepted mime types, or an array of multiple accept validation rules:

Simple

accept: image/jpeg, image/png

Extended

accept:
    mime: image/*
    maxheight: 200
    orientation: landscape
Option Value
mime e.g. image/jpeg
maxheight integer
maxsize integer
maxwidth integer
minheight integer
minsize integer
minwidth integer
orientation landscape/square/portrait

Options

With options, you can control all the file actions that should or should not be available for this particular file type. The option dropdown for files will adjust accordingly.

Option Value
changeName true/false
delete true/false
replace true/false
update true/false

Examples

You can find examples of file blueprints in the samples section.