Customizing Grids

Grids in Sylius are responsible for rendering lists of entities in the administration panel, such as products, customers, or orders. You can customize grids declaratively in YAML or programmatically using event listeners.

If you’re new to Sylius grids, we recommend starting with the SyliusGridBundle documentation.

Why Customize a Grid?

Typical use cases include:

  • Removing or modifying fields

  • Changing or disabling filters

  • Adjusting grid actions (e.g., buttons)

  • Reordering items

  • Programmatically extending grids with PHP

YAML-Based Customizations

The recommended and most common way to customize grids in Sylius 2.0 is by editing the config/packages/_sylius.yaml file.

✅ Removing a Field

# config/packages/_sylius.yaml
sylius_grid:
    grids:
        sylius_admin_product_review:
            fields:
                title:
                    enabled: false

This will hide the title field on the product review grid.

✅ Modifying a Field

You can also localize the label using the translation system — see the Customizing Translations guide.


✅ Removing a Filter


✅ Removing an Action

This disables the delete action on each row.


✅ Modifying an Action

You can customize an action's label and destination route:


✅ Reordering Fields, Filters, or Actions

Use the position option to control order:

This reorders the fields top-to-bottom in the grid.


PHP-Based Customizations (via Events)

In Sylius 2.0, grids can also be extended programmatically. Each grid dispatches an event during configuration.

Example: Modifying the Product Grid in PHP

Let’s say we want to:

  • Remove the image field

  • Add a variantSelectionMethod field

Registering the Listener


Advanced configuration: Pagination Options

The following options are enabled by default on all grids:

These options improve pagination performance on large datasets (especially for databases with over 1M rows) but may increase the number of executed queries. If your use case requires disabling them, you can override them per grid:

This is an optional performance optimization toggle - not required unless you encounter pagination or performance issues.

Last updated

Was this helpful?