Page Graph Widget 

Extension key

page_graph

Package name

rtfirst/page-graph

Version

1.0

Language

en

Author

Roland Tfirst

License

This document is published under the GPL-2.0-or-later license.

Rendered

Sat, 21 Mar 2026 13:17:12 +0000


A TYPO3 dashboard widget that visualizes the page tree and content elements as an interactive force-directed graph.

Page Graph Widget showing the TYPO3 page tree as a force-directed graph

The Page Graph widget in the TYPO3 dashboard.


Introduction 

What does this extension do and who is it for?

Installation 

How to install the extension.

Configuration 

Configuration options.

Usage 

How to use the Page Graph widget.

Developer 

Technical details for developers.

FAQ 

Frequently asked questions.

Introduction 

The Page Graph Widget extension provides an interactive force-directed graph visualization of the TYPO3 page tree and content elements directly in the TYPO3 dashboard.

What does it do? 

  • Displays the page tree as a network graph with nodes and links
  • Optionally shows content elements connected to their parent pages
  • Provides hover highlighting, click-to-select, and search filtering
  • Allows direct editing of pages and content elements via pencil links
  • Supports light and dark mode across TYPO3 12, 13, and 14

Who is it for? 

  • Editors who want a visual overview of their site structure
  • Administrators reviewing page tree complexity
  • Developers debugging page hierarchies and content placement

Installation 

The recommended way to install this extension is via Composer.

Composer 

Install via Composer
composer require rtfirst/page-graph
Copied!

Then activate and clear caches:

Activate the extension
vendor/bin/typo3 extension:setup
vendor/bin/typo3 cache:flush
Copied!

Requirements 

  • TYPO3 12.4, 13.x, or 14.x
  • PHP 8.1 or higher
  • TYPO3 Dashboard system extension (typo3/cms-dashboard)

Configuration 

The Page Graph widget works out of the box without any configuration.

Widget Options 

The widget is registered with the following defaults in Services.yaml:

  • includeContent: true — show content element nodes by default
  • refreshAvailable: true — allow dashboard refresh
  • height: large — large widget height
  • width: large — large widget width

These can be customized by overriding the widget service definition in your own extension's Services.yaml.

Usage 

Adding the Widget 

  1. Navigate to the Dashboard module in the TYPO3 backend
  2. Click Add widget
  3. Select Page Graph from the content group
  4. The widget displays your page tree as an interactive graph

Interactions 

Hover 

Move your mouse over a node to highlight it and its directly connected neighbors. All other nodes are dimmed.

Click 

Click a node to open the info panel showing:

  • Record ID, type, and group
  • CType and ColPos for content elements
  • Doktype for pages
  • Hidden status
  • List of connected nodes (clickable)
  • Pencil edit link to open the TYPO3 record editor

Toggle Content Elements 

Use the "Content Elements" checkbox to show or hide content element nodes and their links.

Layout Modes 

Use the layout dropdown to switch between different graph layouts:

  • Force (default) — physics-based layout
  • Top-Down / Bottom-Up / Left-Right / Right-Left — hierarchical tree layouts
  • Radial — tree arranged in concentric circles

Toggle References 

Use the "References" checkbox to show cross-page reference and navigation links instead of content elements.

Persistent Settings 

The widget remembers your settings (layout mode, content/reference toggles) in the browser's localStorage. When you return to the dashboard, the widget restores your last configuration automatically. Settings are stored per browser origin, so multiple TYPO3 installations on different domains do not interfere with each other.

Dark Mode 

The widget automatically detects the current theme:

  • TYPO3 13+: Reads data-bs-theme attribute
  • TYPO3 12: Falls back to OS preference via prefers-color-scheme

Developer 

Architecture 

The extension consists of two main PHP classes and a JavaScript module:

PageGraphDataProvider 

RTfirst\PageGraph\Service\PageGraphDataProvider queries the pages and tt_content tables and builds a graph data structure with nodes and links.

  • Respects backend user page permissions
  • Excludes deleted records and sys_folder pages (doktype 255)
  • Generates backend edit URLs for each record

PageGraphWidget 

RTfirst\PageGraph\Widgets\PageGraphWidget implements five dashboard widget interfaces for cross-version compatibility:

  • WidgetInterface — base rendering
  • RequestAwareWidgetInterface — access to the PSR-7 request
  • EventDataInterface — passes graph data to JavaScript
  • AdditionalJavaScriptInterface — loads force-graph library
  • AdditionalCssInterface — loads widget styles

JavaScript 

PageGraphWidget.js listens for the widgetContentRendered custom event dispatched by the TYPO3 dashboard and initializes the force-graph canvas.

Graph Data Structure 

The getGraphData() method returns:

Graph data structure
{
    "nodes": [
        {"id": "p-3", "uid": 3, "label": "Home", "type": "page", ...},
        {"id": "c-42", "uid": 42, "label": "Welcome", "type": "content", ...}
    ],
    "links": [
        {"source": "p-3", "target": "p-5", "type": "tree"},
        {"source": "p-3", "target": "c-42", "type": "content"}
    ],
    "meta": {"totalPages": 25, "totalContent": 87}
}
Copied!

Unit Tests 

The extension ships with PHPUnit unit tests located in Tests/Unit/.

Run tests locally 

Run from the DDEV project root
ddev exec "cd packages/page_graph && ../../vendor/bin/phpunit \
    --bootstrap ../../vendor/autoload.php Tests/Unit/"
Copied!

Test structure 

  • Tests/Unit/Service/PageGraphDataProviderTest.php — Tests the data provider including page/content node generation, depth calculation, doktype and CType group mapping, tree links, and navigation links.
  • Tests/Unit/Widgets/PageGraphWidgetTest.php — Tests the widget's JS/CSS file paths, options handling, request guards, and event data delegation.

Updating Vendor Libraries 

The bundled force-graph library can be updated with the provided shell script. No npm or Node.js installation is required for end users — the minified file is always committed to Git.

Update to the latest version
cd packages/page_graph
bash Build/update-vendor.sh
Copied!
Update to a specific version
bash Build/update-vendor.sh 1.52.0
Copied!

The script:

  • Fetches the minified build from unpkg.com
  • Prepends a version comment to the first line
  • Updates the version reference in Resources/Public/JavaScript/Vendor/LICENSE.md

After updating, verify the widget still works in the TYPO3 dashboard and commit the changed files.

Cross-Version Compatibility 

The extension supports TYPO3 12.4, 13.x, and 14.x. It avoids JavaScriptInterface (not available in v12) and uses BackendViewFactory instead of deprecated StandaloneView.

FAQ 

The widget is empty 

Make sure the Dashboard system extension is installed and that your backend user has permission to view pages. The widget respects TYPO3's page access permissions.

The graph looks cluttered 

Toggle off "Content Elements" to see only the page tree structure. Use the search field to find specific pages.

Dark mode is not working 

In TYPO3 13+, dark mode is controlled by the data-bs-theme attribute set via user settings. In TYPO3 12, the widget falls back to your operating system's color scheme preference.