Extensible header controls with shared desktop/mobile rendering

Aperta
#7,906 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php
Ambito
backend

Direzione di ricerca

Start with templates/layout.html.twig and compare the header_custom_menu and settings_dropdown_wrapper desktop blocks with the responsive header path. Then review the Twig components and UI Kit mentioned in the issue to understand how they could fit a shared extension point. Done means documenting a backward-compatible way to add ordered controls for desktop and mobile while preserving the existing default layout, with examples for the locale selector and a custom dropdown.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

design feature
Description

Now that EasyAdmin has Twig components, the UI Kit, and the refreshed design, could we provide a documented way to add application-specific controls to the top navigation, shared by desktop and mobile?

This builds on #6900, which requested an independent locale dropdown like Symfony Demo and was closed automatically for inactivity. I added an updated proposal there, but could not reopen the issue: https://github.com/EasyCorp/EasyAdminBundle/issues/6900#issuecomment-6714138968

Current limitation

On the current 5.x branch, desktop header customization and the responsive header follow separate template paths in templates/layout.html.twig. Desktop exposes blocks such as header_custom_menu and settings_dropdown_wrapper, while the responsive header renders its controls separately.

Adding an application-specific control in both places therefore requires knowing and overriding layout internals. The UI Kit provides reusable components, but a supported place to compose those components into the header would make them much more useful.

Use cases
  • Locale selection: keep the current Settings placement by default, with an option to display a standalone language dropdown in the header, as Symfony Demo does. Both placements should reuse the same locale-switching implementation.
  • Recently visited: render an application-provided dropdown of recently visited pages alongside the built-in controls. The application supplies the history and handles permissions; EasyAdmin supplies the placement and presentation.
Proposed direction
  • Add a documented header extension point shared by desktop and mobile, allowing applications to render EasyAdmin components or their own Twig components.
  • Preserve the existing default layout and template extension points.
  • Define placement, ordering, and responsive behavior so application authors do not need to duplicate the surrounding header markup.
  • Demonstrate the built-in locale selector and a custom dropdown in the UI Kit or documentation.

The exact API is open for discussion: a shared Twig block/slot may be enough initially, rather than introducing a large new configuration system.

Would you be open to a PR in this direction? Happy to start with a small, backward-compatible extension point and locale selector example, following your preferred API.

Lingua principale
PHP
Stelle
4.3k
Fork
1.1k
Merge medio
2g 9h
PR unite (30g)
52

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di EasyCorp/EasyAdminBundle

Tutte le issue di EasyCorp/EasyAdminBundle

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.