Dashboards with Layout Builder

Provides customizable dashboards using Layout Builder, allowing administrators to create personalized admin pages with configurable widgets and charts.

dashboards
3,411 sites
91
drupal.org

Install

Drupal 11, 10, 9 v2.1.10
composer require 'drupal/dashboards:^2.1'

Overview

The Dashboards module enables the creation of fully customizable dashboards using Drupal's Layout Builder. It provides a complete dashboard system where administrators can build admin pages using configurable blocks and widgets.

Key capabilities include: creating multiple dashboards as configuration entities that can be exported and imported between environments, per-user dashboard personalization allowing users to customize their own dashboard layouts, integration with the Drupal toolbar for easy access, built-in chart support for data visualization, and a plugin system for creating custom dashboard components.

The module includes various built-in dashboard plugins for common use cases such as content statistics, system status, RSS feeds, error reports, and embedded views. Additional submodules provide integration with Matomo analytics, Webform submissions, and core statistics.

Features

  • Create customizable dashboards using Layout Builder's drag-and-drop interface
  • Dashboard personalization per user - each user can override the default dashboard layout for their own view
  • All dashboards are configuration entities that can be exported and version controlled
  • Custom dashboard plugin system for creating reusable dashboard components
  • Built-in chart integration supporting pie, bar, line, radar, polar area, doughnut, and bubble charts with configurable color maps
  • Toolbar integration providing quick access to all dashboards
  • Theme negotiator for automatic admin theme switching on dashboard pages
  • Multiple built-in layout options (2 columns, 3 columns, 2+1 column)
  • Support for embedded Views displays on dashboards
  • RSS feed reader plugin for displaying external news
  • System information widgets (status, errors, updates, 404 reports)
  • Node statistics plugin showing content type distribution
  • Content creation shortcut menu
  • User profile display widget
  • Gin admin theme support with dedicated templates
  • Layout Builder Restrictions integration for controlling available blocks

Use Cases

Content Editor Dashboard

Create a dashboard for content editors that shows their recently authored content, content awaiting review, and quick links to create new content. Use the 'Dashboard: My last content' view embed and the 'Add content' menu plugin.

Site Administrator Dashboard

Build a comprehensive admin dashboard showing system status, available module updates, recent errors and warnings from the log, and 404 error reports. Combine the system_info, status_updates, error_report, and report_not_found plugins.

Analytics Dashboard

Using the Matomo submodule, create an analytics dashboard showing visitor statistics, geographic distribution, browser usage, and top performing pages. Configure date ranges and chart types for each widget.

Content Overview Dashboard

Display content statistics with pie or bar charts showing distribution by content type, along with tables of recently published content. Use node_statistics plugin with the views embed plugin.

Personalized User Dashboards

Allow each user to customize their own dashboard layout. Administrators set up a default dashboard, then grant 'can override' permission to specific roles so users can rearrange or remove widgets to suit their workflow.

News Aggregation Dashboard

Create a dashboard that aggregates content from external RSS feeds alongside internal content. Use multiple rss_news plugins configured for different news sources.

Tips

  • Use the weight field to control the order dashboards appear in the toolbar dropdown menu
  • Dashboard configurations can be exported using Configuration Management, making it easy to deploy dashboards across environments
  • The chart colormap can be changed globally at /admin/system/dashboards-settings to match your site's branding
  • For better performance with external data sources like RSS feeds or Matomo, the module uses lazy building and caching - consider the cache expiration times when displaying time-sensitive data
  • When creating custom dashboard plugins, extend DashboardBase and implement buildRenderArray() - the plugin will automatically be available as a block in Layout Builder
  • Use DashboardLazyBuildBase for plugins that make external API calls to improve page load performance
  • Grant granular permissions per dashboard - you can allow users to view certain dashboards but only personalize specific ones
  • The module automatically handles cache invalidation when dashboards are modified or personalized

Technical Details

Admin Pages 8
Dashboards /admin/structure/dashboards

Lists all available dashboards with drag-and-drop reordering support. From here, administrators can view, edit, manage layouts, delete dashboards, and create new ones.

New dashboard /admin/structure/dashboards/add

Form for creating a new dashboard entity. Define the administrative label, machine name, category, display settings, and weight.

Edit Dashboard /admin/structure/dashboards/manage/{dashboard}

Edit form for modifying dashboard settings including label, category, frontend theme setting, and weight.

Dashboards Settings /admin/system/dashboards-settings

Global configuration for dashboard appearance, primarily for chart colors and styling.

Dashboard View /dashboard/{dashboard}

View a specific dashboard with all its configured blocks and widgets. Users with permission can personalize the layout from this page.

Default Dashboard Layout /dashboards/{dashboard}/layout

Layout Builder interface for configuring the default dashboard layout. Add, remove, and arrange blocks using drag-and-drop. All dashboard plugins appear as blocks that can be placed in layout regions.

Personalize Dashboard /dashboard/{dashboard}/override

Layout Builder interface for users to personalize their own dashboard view. Changes are stored per-user and do not affect the default dashboard.

Dashboard Permissions /admin/structure/dashboards/manage/{dashboard}/permissions

Configure role-based permissions specifically for this dashboard, including view and override permissions.

Permissions 3
Administer dashboards

Allows users to create, edit, delete, and manage layouts for all dashboards

Can view {dashboard} dashboard

Dynamically generated permission for each dashboard allowing users to view that specific dashboard

Can override {dashboard} dashboard

Dynamically generated permission for each dashboard allowing users to personalize that specific dashboard layout

Hooks 1
hook_dashboards_dashboard_info_alter

Allows modules to alter dashboard plugin definitions

Troubleshooting 6
Cannot save layout changes when Layout Builder Restrictions is enabled

Update Layout Builder Restrictions to version 2.2 or later. Earlier versions have a bug preventing saves with custom section storage plugins.

Dashboard does not show in admin theme

Ensure the 'Show always in frontend theme' checkbox is unchecked when editing the dashboard. Also verify the user has the 'view the administration theme' permission.

Error reports or 404 reports show 'DBLog module is not enabled'

Enable the core Database Logging (dblog) module. These plugins require watchdog data to function.

Module update status shows 'Could not get updates' or requires Update module

Enable the core Update Manager module and ensure cron is running to fetch update information.

User personalized dashboard not saving

Verify the user has the 'can override {dashboard_id} dashboard' permission for that specific dashboard.

View embed plugin shows no views available

Create a View with an 'Embed' display type. Only Views configured with embed displays can be used with the view_embed plugin.

Security Notes 4
  • Dashboard personalization data is stored per-user using the User Data API and is deleted when users are removed or the module is uninstalled
  • The 'administer dashboards' permission grants full control over all dashboards - assign it only to trusted administrator roles
  • View and override permissions are generated dynamically for each dashboard, allowing fine-grained access control
  • The module properly handles serialization of user override data with restricted allowed classes to prevent object injection vulnerabilities