Skip to content

Add dashexample module for the new Symfony dashboard hooks#254

Open
mattgoud wants to merge 1 commit into
PrestaShop:masterfrom
mattgoud:add/dashexample-module
Open

Add dashexample module for the new Symfony dashboard hooks#254
mattgoud wants to merge 1 commit into
PrestaShop:masterfrom
mattgoud:add/dashexample-module

Conversation

@mattgoud

Copy link
Copy Markdown

Description

Adds a new example module, dashexample, that demonstrates how a module integrates with the migrated (Symfony) Back Office Dashboard through its new dedicated hook family.

It is both living documentation of the integration contract and a validation vehicle for the dashboard migration (core issue PrestaShop/PrestaShop#41968).

What it demonstrates

  • Registering on the new dashboard hooks: displayAdminDashboardZoneOne, displayAdminDashboardZoneTwo, displayAdminDashboardToolbar.
  • Rendering hook content through module Twig templates — no Smarty, no HelperForm, no Db::getInstance().
  • Using hook parameters (date_from / date_to).
  • Loading the module's own CSS/JS assets from its hook output — no actionAdminControllerSetMedia, no get_class($this->context->controller) detection.

The README.md explains the legacy-vs-Symfony hook families and how a single module can register on both to support multiple PrestaShop versions.

Requirements

  • PrestaShop 9.2.0+ (introduces the migrated dashboard and its hooks).
  • The dashboard feature flag enabled (Advanced Parameters > New & Experimental Features).

How to test

  1. On a 9.2.0+ shop, enable the dashboard feature flag.
  2. Install the module: php bin/console prestashop:module install dashexample.
  3. Open the Dashboard: the module renders blocks in Zone One and Zone Two, plus a marker in the toolbar area, and its own CSS/JS are loaded.
  4. Disable the flag: the legacy dashboard is unaffected (the module registers only the new hooks).

Related

Registers displayAdminDashboardZoneOne, displayAdminDashboardZoneTwo and
displayAdminDashboardToolbar, rendering content through module Twig templates
(no Smarty, no HelperForm, no Db::getInstance()) and loading its own assets
from its hook output (no actionAdminControllerSetMedia / class-name detection).

Serves as living documentation of the new integration contract and as a
validation vehicle for the migrated dashboard (PrestaShop/PrestaShop#41968).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant