Magento 2 Layout – Moving Layered Navigation Below Product Toolbar in layout.xml

layered-navigationlayoutmagento2product-list

I'm having some issues re-ordering elements within following file:

[MyTheme]/Magento_Catalog/layout/catalog_category_view.xml

I'm trying to move the layered navigation below the product toolbar, above the products grid.

I've tried, the following:

<move element="sidebar.main" destination="category.products.list" after="product_list_toolbar"/>


   <move element="catalog.navigation.renderer" destination="category.products.list" after="product_list_toolbar"/>
    <move element="catalog.leftnav" destination="category.products.list" after="product_list_toolbar"/>
    move element="catalog.navigation.state" destination="category.products.list" after="product_list_toolbar" />

This removes the filter entirely, instead of moving it.

Am I correct to try and move this element within the theme catalog_category_view.xml? Or should this be moved with a custom Layered Navigation module ?

An update on this, i was able to move the layered nav to the top of the page via

 <move element="catalog.leftnav" destination="content" before="category.products"/>

if i set the destination to any more deeply nested blocks the nav just disappears.

I've also tried to move the product toolbar around the layered nav, like so

    <move element="product_list_toolbar" destination="content" before="-"/>

The nav is still appearing above the toolbar though.

Best Answer

The solution i came up with is as follows:

<move element="catalog.leftnav" destination="category.product.list.additional" before="-"/>
Related Topic