Edit on GitHub
Jump to docs navigation

Field Types / Filelist field

Note: You are currently reading the documentation for Bolt 4.0. Looking for the documentation for Bolt 3.7 instead?

A simple list field type to upload/select files. Also contains a title text field for each file.

Basic Configuration:

            type: filelist

Example usage in templates:

{% for file in record.attachments %}
    <a href="/files/{{ file.filename }}">{{ file.title }}</a>
{% endfor %}


The field has a one option to change the functionality of the field:

  • extensions Allows you to restrict users to only be able to upload files with certain file extensions
  • upload Allows you to upload files for this field into a specified directory so they remain grouped. This directory will be created in {%web%}/files/
            type: filelist
            extensions: [ png, pdf ]
            upload: portfolio

Default value

The filelist field can be instantiated with an array of files as default value using the default: option like so:

            type: filelist
                    filename: "2019.pdf"
                    title: "2019 document"
                    filename: "2020.pdf"
                    title: "2020 document"

Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.