Skip to content

Password protected view mode

When a protected content is displayed, if the user does not have access to the content then it is the "Password protected" view mode that is displayed instead.

In fact it is a view mode with the machine name password_protected that is used.

Configure the display

The "Password protected" display only shows what it is configured to show:

  • Enable it in Manage display > Custom display settings. Otherwise Drupal uses the "Default" display to render the "Password protected" view mode, so all the fields of the "Default" display are shown with the password form.
  • Show the password field with the Password form formatter.
  • Disable all the fields you want to protect.

See Getting started for the complete configuration.

Other entity types

By default the module provides the view mode for the node entity type.

For other entity types you need to create one yourself, in Structure > Display modes > View modes (/admin/structure/display-modes/view), with the machine name password_protected, then enable and configure its display like for nodes.