Extensible header controls with shared desktop/mobile rendering

Open
#7,906 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
php
Domain
backend

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
PHP
Stars
4.3k
Forks
1.1k
Avg merge
2d 9h
Merged PRs (30d)
52

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EasyCorp/EasyAdminBundle

All issues in EasyCorp/EasyAdminBundle

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.