Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Opensolr Search 4.5.0 Minor update available for module opensolr_search (4.5.0). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

This module allows you to control which view mode is displayed for an entity based on a user's role. You can set up rules that determine which view mode is shown, and then assign those rules to individual entities. This can be used for scenarios like creating a paywall where users with specific roles see full content while others see a teaser.

Allows the view mode to be switched based on the user's role per entity.

The purpose of this module is to define "Rules", like the one in the images below, that can be applied to individual entities.

Setup / Use Steps

  1. Define at least one View Mode Switcher Rule.
  2. Add an Entity Reference field to your node that references these rules.
  3. When you edit an entity you can select your "rule".

Whenever a visitor tries to view that entity (node) using the original view mode, the view mode may be switched based on their role.

Example Use Case

I have used this module to act as a paywall that will only allow users with a certain role to view certain "premium" articles. If they do not have the "premium" role they will be shown a teased version of the content when they try to view the article.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
May 2025
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core Release date
2.1.0 Stable 8–11 May 1, 2025