Dashboards with Layout Builder
Provides customizable dashboards using Layout Builder, allowing administrators to create personalized admin pages with configurable widgets and charts.
dashboards
インストール
composer require 'drupal/dashboards:^2.1'
概要
Dashboardsモジュールは、DrupalのLayout Builderを使用して完全にカスタマイズ可能なダッシュボードを作成できます。設定可能なブロックやウィジェットを使用して管理ページを構築できる完全なダッシュボードシステムを提供します。
主な機能には、環境間でエクスポート・インポートできる設定エンティティとして複数のダッシュボードを作成する機能、ユーザーが自分のダッシュボードレイアウトをカスタマイズできるユーザーごとのダッシュボードパーソナライズ機能、簡単にアクセスできるDrupalツールバーとの統合、データ可視化のための組み込みチャートサポート、カスタムダッシュボードコンポーネントを作成するためのプラグインシステムがあります。
このモジュールには、コンテンツ統計、システムステータス、RSSフィード、エラーレポート、埋め込みViewsなど、一般的なユースケース向けのさまざまな組み込みダッシュボードプラグインが含まれています。追加のサブモジュールでは、Matomo分析、Webform送信、コア統計との統合を提供します。
Features
- Layout Builderのドラッグ&ドロップインターフェースを使用してカスタマイズ可能なダッシュボードを作成
- ユーザーごとのダッシュボードパーソナライズ - 各ユーザーが自分の表示用にデフォルトのダッシュボードレイアウトをオーバーライド可能
- すべてのダッシュボードはエクスポートしてバージョン管理できる設定エンティティ
- 再利用可能なダッシュボードコンポーネントを作成するためのカスタムダッシュボードプラグインシステム
- 設定可能なカラーマップで円グラフ、棒グラフ、折れ線グラフ、レーダーチャート、極座標エリアチャート、ドーナツチャート、バブルチャートをサポートする組み込みチャート統合
- すべてのダッシュボードへのクイックアクセスを提供するツールバー統合
- ダッシュボードページでの管理テーマの自動切り替え用テーマネゴシエーター
- 複数の組み込みレイアウトオプション(2カラム、3カラム、2+1カラム)
- ダッシュボードへのViews埋め込み表示のサポート
- 外部ニュースを表示するRSSフィードリーダープラグイン
- システム情報ウィジェット(ステータス、エラー、更新、404レポート)
- コンテンツタイプの分布を表示するNode統計プラグイン
- コンテンツ作成ショートカットメニュー
- ユーザープロフィール表示ウィジェット
- 専用テンプレートによるGin管理テーマのサポート
- 利用可能なブロックを制御するLayout Builder Restrictions統合
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
/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.
/admin/structure/dashboards/add
Form for creating a new dashboard entity. Define the administrative label, machine name, category, display settings, and weight.
/admin/structure/dashboards/manage/{dashboard}
Edit form for modifying dashboard settings including label, category, frontend theme setting, and weight.
/admin/system/dashboards-settings
Global configuration for dashboard appearance, primarily for chart colors and styling.
/dashboard/{dashboard}
View a specific dashboard with all its configured blocks and widgets. Users with permission can personalize the layout from this page.
/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.
/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.
/admin/structure/dashboards/manage/{dashboard}/permissions
Configure role-based permissions specifically for this dashboard, including view and override permissions.
権限 3
Hooks 1
hook_dashboards_dashboard_info_alter
Allows modules to alter dashboard plugin definitions
Troubleshooting 6
Update Layout Builder Restrictions to version 2.2 or later. Earlier versions have a bug preventing saves with custom section storage plugins.
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.
Enable the core Database Logging (dblog) module. These plugins require watchdog data to function.
Enable the core Update Manager module and ensure cron is running to fetch update information.
Verify the user has the 'can override {dashboard_id} dashboard' permission for that specific dashboard.
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