Edit on GitHub
Jump to docs navigation

Field Types / Data field

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

The Data field is like a read-only textarea. It can be used to store data as-is in the JSON format, if your website project has an API that creates Records based on some external output. By using this field, the editors can see the field, but they can not modify the data in it.

Basic Configuration:

            type: data
            label: 'Source data'
            postfix: The original data, as retrieved from the API

It'll look like this in the Bolt backend:

Screenshot of Data Field

Example usage in templates:

{{ record.source }}

Input Sanitisation

All content in this field type will be sanitised before it gets inserted into the database. This means that only 'whitelisted' HTML like <b> and <img src="…"> is kept, while things like <embed> and <script> are scrubbed from the field before being stored. As a site-implementor you can control the whitelisted tags and attributes using the following section in config.yaml:

    allowed_tags: [ div, span, p, br, hr, s, u, strong, em, i, b, li, ul, ol, …, … ]
    allowed_attributes: [ id, class, style, name, value, href, src, alt, title, …, … ]

To disable sanitisation for this field, you can add sanitise: false to the field config, like so:

            type: data
            sanitise: false

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.