Change record status: 
Project: 
Introduced in branch: 
10.1.x
Introduced in version: 
10.1.0
Description: 

A new and optional setting is added to the text field types that lets the site-builder determine if the text formats should be restricted. This setting is then used in the default textfield and textarea widgets to remove any non-allowed text formats. If nothing is set, the current behavior is unchanged.

Field API example:

return [
  ...
  'field_type' => 'text',
  'settings' => [
    'allowed_formats' => [],
  ],
  ...
];

Field UI settings example:

Allowed text formats under field settings

AttachmentSize
text-formats.png31.39 KB
Impacts: 
Site builders, administrators, editors

Comments

ressa’s picture

It seems counter intuitive that none of the options under "Allowed text formats" are checked in the image ...

w01f’s picture

Agreed - perhaps a note that all are allowed by default?

aaronmchale’s picture

Also agree. The issue was not recently reviewed at the usability group, I will raise it at a meeting and depending on the outcome a follow-up issue may be created to address any changes that are recommended by the group.

ressa’s picture

Sorry if I wasn't precise enough. Actually, it says below the options:

If no formats are selected, all available text formats will be displayed to the user.

But my point is mostly that if the image is supposed to show case this new feature, I would think that checking for example "Restricted HTML" would be more informative:

Allowed text formats
  Basic HTML
x Restricted HTML
  Full HTML
  Plain text
Select the allowed text formats. If no formats are selected, all available text formats will be displayed to the user.

... and then below the UI settings image, another image could show the node edit form in action, with no format selection options, to show the result: That you can now only use Restricted HTML format.

bramdriesen’s picture

Makes sense. I just grabbed a screenshot that was posted in the issue queue. The help text also indeed seems to be missing. I'll check if I can spin up a clean install to grab a more up to date screenshot.