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
- Define at least one View Mode Switcher Rule.
- Add an Entity Reference field to your node that references these rules.
- 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.