Drupal is a registered trademark of Dries Buytaert
cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)!
REST Views

This module enhances the functionality of Views that use the REST Export display to export serialized data.

Introduction

When you create a view with a REST Export display, you will quickly encounter hard limitations on the data structure, imposed by the Views module's reliance on the Render API:

  • You may want to export a field with multiple values as an array. By default, this is only possible by exporting the raw field, as the rendering process also concatenates the output into a single string.

  • An entity reference can only be exported as a fully rendered string, and not as a nested structure with multiple individual fields.

  • Boolean and numeric fields can only be exported as strings, rather than the appropriate JSON primitives.

  • Contributed module exports (Such as paragraphs, geo field, and search api) require their respective sub modules to be enabled as well.

The Views and Field plugins in this module add all of these features.

Usage

After installing this module, each entity field can be accessed in Views via a new handler named "Field (Serializable)".

This field handler automatically exports multiple-value fields as arrays. This is dependent on the cardinality in the schema, so it will be applied even if the field contains less than two actual values.

Furthermore, the following fields will have new field formatters designed to export non-string values:

(Note that these will only work in combination with the Serializable handler.)

Nested entity references: In general these require a custom display mode where the fields are formatted with export formats unless you want rendered html. See the links below for specific discussions.

Extending

You can create your own field formatter plugins that export arbitrary data structures based on a field's values:

 $item) {
      $data = '[A data structure based on $item.]';
      $elements[$delta] = [
        '#type' => 'data',
        '#data' => SerializedData::create($data),
      ];
    }

    return $elements;
  }

}

Security

This module does not add any output filtering beyond that which has already been applied. In practice this means:

  • All fields with normal non-Export formatters (including those inside referenced entities) are rendered, and therefore contain safe HTML markup, provided their modules are working securely.
  • The Export field formatters export raw values.

If both kinds of formatters are used in the same view, clients should be made aware which values are markup and which are untreated strings. In all cases, the client application is responsible for safely using the exported data.

Activity

Total releases
1
First release
Jun 2026
Latest release
16 hours ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
3.x-dev Dev Jun 15, 2026