Description
In this episode, you’ll learn how to create a custom grid action in Sylius – a contextual admin button that adds new behavior to an existing grid. As an example, you’ll build a “Show products” button in the brand grid, allowing quick access to products related to a given brand.
You’ll learn:
- How to create a custom Twig template for the action, customizing icon and color,
- How to register the custom action (e.g. show_products) in your grid configuration,
- How to add it to a specific grid (like sylius_admin_brand),
- How to pass dynamic parameters (like brand.code) to the target route,
- How to extend Sylius’s admin UI without touching vendor code.
Final result:
- A new “Show products” button appears in the brand grid,
- Clicking it opens a filtered list of products for that brand,
Admins can navigate faster and manage brands/products more efficiently.