Dashboard

Provides customizable dashboards with Layout Builder integration for creating personalized admin experiences.

dashboard
6,956 sites
22
drupal.org

Install

Drupal 11 v2.1.2
composer require 'drupal/dashboard:^2.1'
Drupal 10 v2.0.1
composer require 'drupal/dashboard:^2.0'

Overview

The Dashboard module provides a flexible system for creating and managing customizable dashboards in Drupal. It leverages the Layout Builder module to allow administrators to design dashboard layouts by arranging blocks and content in sections.

Each dashboard is a config entity that can be independently configured with its own layout, permissions, and display order. Users are automatically redirected to their accessible dashboard upon login, providing a personalized landing page experience.

The module includes built-in Views blocks for displaying user-specific content such as recent content, drafts, and edited content. It integrates seamlessly with the Gin admin theme, Coffee module for quick navigation, and the core Navigation module for toolbar integration.

Features

  • Create multiple customizable dashboards using Layout Builder for flexible content arrangement
  • Assign per-dashboard view permissions to control which user roles can access each dashboard
  • Automatic redirect to the user's first accessible dashboard after login
  • Weight-based ordering to control dashboard display priority when multiple dashboards exist
  • Built-in Views blocks for user-specific content: recent content, drafts, edited content, and site-wide content management
  • Dashboard Text block for adding custom formatted text to dashboards
  • Site Status block for displaying system requirement errors on the dashboard
  • Integration with Gin admin theme for enhanced styling
  • Coffee module integration for quick dashboard navigation via keyboard commands
  • Navigation module integration for dashboard link in the admin toolbar
  • Preview mode for testing dashboard layouts before publication
  • Drag-and-drop reordering of dashboards in the admin list

Use Cases

Content Editor Dashboard

Create a dashboard for content editors showing their drafts, recently edited content, and quick links to create new content. Assign the view permission to the Content Editor role, and editors will see this as their landing page after login.

Administrator Overview Dashboard

Build a comprehensive admin dashboard displaying site status errors, recent site content, and system monitoring blocks. This provides administrators with a quick overview of site health and recent activity.

Role-Based Landing Pages

Create multiple dashboards with different layouts for different user roles. Marketing team members might see campaign-related content, while developers see deployment status and error logs. Each dashboard can be tailored to specific workflow needs.

Site Health Monitoring

Add the Site Status block to an admin dashboard to display system requirement errors prominently. Combined with the Gin theme integration, this provides a clean interface for monitoring site health.

Quick Navigation Hub

Use the Dashboard Text block to create a navigation hub with important links, announcements, and helpful resources for team members. The Layout Builder allows flexible arrangement of content sections.

Tips

  • Create a new dashboard before removing an existing one to ensure users always have a landing page
  • Use weight ordering strategically - the dashboard with the lowest weight becomes the default for users with access to multiple dashboards
  • The Coffee integration allows quick access to dashboards by typing ':dashboard' followed by the dashboard machine name
  • For Gin theme users, dashboard styling is automatically enhanced without additional configuration
  • Preview your dashboard layout before enabling it to ensure the arrangement looks correct
  • Consider using the built-in Views blocks for personalized content displays before creating custom blocks
  • Dashboard permissions are independent - users can have access to some dashboards but not others

Technical Details

Admin Pages 6
Dashboard /admin/dashboard

The main dashboard page that displays the user's default accessible dashboard. Users are automatically redirected here after login if they have permission to view at least one dashboard. The dashboard content is rendered using Layout Builder sections.

Dashboard configuration /admin/structure/dashboard

Administrative page for managing all dashboards. Provides a list of existing dashboards with their status, and allows reordering via drag-and-drop to control display priority.

Add a dashboard /admin/structure/dashboard/add

Form for creating a new dashboard. After creation, the dashboard will need its layout configured and permissions assigned before users can access it.

Edit a dashboard /admin/structure/dashboard/{dashboard}

Form for editing an existing dashboard's basic settings. The layout is edited separately using the Layout Builder interface.

Manage permissions /admin/structure/dashboard/{dashboard}/permissions

Configure which user roles can view this specific dashboard. Each dashboard has its own 'view [dashboard_id] dashboard' permission that can be assigned to any role.

Preview /admin/structure/dashboard/{dashboard}/preview

Preview the dashboard as it will appear to users. This allows administrators to verify the layout and content before enabling the dashboard.

Permissions 2
Administer dashboard

Allows users to create, edit, delete, and configure all dashboards. This is the administrative permission for managing the dashboard system.

Access to [Dashboard name] dashboard

Dynamically generated permission for each dashboard. Grants users the ability to view a specific dashboard. Users need this permission to access the dashboard content.

Hooks 7
hook_user_login

Redirects users to their default dashboard after login. The redirect is skipped if a destination parameter is already set or if the user is on the password reset page.

hook_coffee_commands

Provides Coffee module commands for quick navigation to dashboards. Creates a command for each accessible dashboard.

hook_library_info_alter

Adds Gin theme-specific CSS when the Gin admin theme is active. Enhances dashboard styling for Gin users.

hook_toolbar_alter

Attaches the dashboard toolbar library to the admin toolbar for icon display.

hook_menu_local_tasks_alter

Removes duplicate dashboard tabs from the local tasks menu and adds proper cache metadata.

hook_navigation_defaults

Provides default navigation block configuration for the Navigation module integration.

hook_block_alter

Marks dashboard internal blocks as hidden from the block UI since they should only be used in dashboards.

Troubleshooting 5
Users are not being redirected to the dashboard after login

Ensure the user has the 'view [dashboard_id] dashboard' permission for at least one enabled dashboard. Also check that no destination parameter is being set by other modules during login.

Dashboard not appearing in the admin menu

Verify the dashboard is enabled and the user has permission to view it. The dashboard link only appears for users who can access at least one dashboard.

Layout Builder changes are not saving

Make sure to click 'Save layout' rather than navigating away. The Layout Builder uses a tempstore for changes until explicitly saved.

Blocks added to dashboard are not displaying

Check that the block's access conditions are met. Some blocks (like Site Status) only display when certain conditions are true (e.g., when there are errors).

Navigation module dashboard link not showing

The Navigation dashboard block requires the user to have permission to view at least one dashboard. Verify permissions are correctly assigned.

Security Notes 4
  • Dashboard view permissions are enforced on both the route and entity access levels for comprehensive protection
  • The 'administer dashboard' permission should only be granted to trusted administrators as it allows creating and modifying all dashboards
  • Each dashboard's content is subject to the individual block's access controls in addition to the dashboard permission
  • The password reset page redirect is intentionally skipped to prevent security issues during password recovery