Transform modes

Last updated on
21 September 2023

Drupal core includes two display mode types by default: view modes and form modes. Transform API adds a third type called transform mode which is generally equivalent to view modes but made to configure how entities are transformed into JSON instead of HTML.

New transform modes can be created in the Drupal backend under Structure → Display modes → Transform modes or through the path /admin/structure/display-modes/transform

Afterwards these can be utilized for their entity types next to where you normally configure view and form modes in the field UI. For example for a the Simple Page content type you would go to /admin/structure/types/manage/page/transform

Here you can (per transform mode) configure which FieldTransform plugin will be used to transform a field on the entity or hide it if you do not want it transformed.

After configuring your fields and transform modes, just click save and you can export the configuration, ready to be imported on production.

Help improve this page

Page status: No known problems

You can: