This project is not covered by Drupal’s security advisory policy.

The View Mode By Role (VMBR) module allows site administrators to assign
custom view modes for both users and content (nodes) based on user roles.

With this module, you can:

  • Define a default user view mode for each role.
  • Define a default content (node) view mode for each role.
  • Assign weights to roles so that, when a user has multiple roles, the role with the highest priority determines the view mode.
  • Fall back to the standard full view mode when no custom setting is defined.

Key Features

  • Adds configuration fields on each role edit form to select:
    • User View Mode
    • Content View Mode
    • Role Priority Weight
  • Automatically alters entity rendering to apply the configured view mode for logged-in users.
  • Supports Drupal 8, 9, 10, and 11.

Example Use Cases

  • Show different profile layouts for editors vs. subscribers.
  • Display different node layouts (teasers, compact, or custom view modes) depending on whether a visitor is anonymous, a customer, or an administrator.
  • Prioritize roles (e.g., if a user is both “Customer” and “VIP,” ensure the VIP view mode takes precedence).

Requirements

  • None — works with core entity and role system.

Compatibility

  • Works with all entity view modes registered for user and node entities.
  • Fully compatible with Drupal’s role system and multi-role assignments.

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • Project categories: Access control
  • chart icon7 sites report using this module
  • Created by tanvirahmad on , updated
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.

Releases