Drupal 8's Allowed Formats module

Published September 22, 2018

Drupal 8's text format system provides a way for developers to manage user generated content, regardless of if the user is trusted staff member or an anonymous commenter. With intelligent configuration of various text formats for the various roles on the site, the security and usefulness of a site can be maximized.

Much like Drupal 7's Better Formats module, Drupal 8's Allowed Formats module allows a developer to limit the text formats that are available on the field level. Normally, all formats that the user has access to are available on all fields, this module allows developers to force a particular format to be applied on a particular field.

The configuration is available on all formatted fields' "edit" page. For example, take this configuration for a "short summary" field.

Allowed Formats example

In this example, only the "Minimal HTML" format will be available for this field, regardless of if the current user has permission to use any of the other formats. For this application, the "short summary" field can only have links, strong text, and emphasized text. By limiting authors to only the "Minimal HTML" text format for this field, these parameters can be easily enforced.

Sign up to receive email notifications of whenever we publish a new blog post or quicktip!