3

Running 2.2.5 (Luma)

In the category, when I use Display Mode: Products only or Static block and products, the layered navigation is clearly visible on the frontend. However, as soon as I switch to Static block only the Layered Navigation is no longer visible.

I've tried this on 2 seperate 2.2.5 installations. Did something change since 2.2.2 because I'm sure this used to work before upgrading.

EDIT: I just installed 2.2.2 (Luma + Sample Data) and tested. It seems this didn't used to happen.

3
  • Seems, this is normal. Whenever I select category Display Mode: Static Block Only. The layered navigation and products should not be visible. Because I select this mode to show only static block's contents in the category page, not products or filter. Commented Jul 23, 2018 at 12:04
  • Magento 2 Demo Data circumvented that by using <referenceContainer name="catalog.leftnav" remove="true"/> in the Layout Update XML section of the category. Perhaps this updated change is in fact by design. So that leads me to the question, How do I get it back...
    – Craig
    Commented Jul 23, 2018 at 12:07
  • @Craig I saw this behaviour return in 2.3.3 where in display mode static block only I still got layered nav, but in 2.3.4 it seems to be gone again - no layered nav. Did you ever find a workaround?
    – paj
    Commented Feb 26, 2020 at 10:55

1 Answer 1

1

Magento core saw that functionality as a bug see https://github.com/magento/magento2/issues/17038

In the code difference between M2.3.3 and 2.3.4 (https://github.com/magento/magento2/compare/2.3.3...2.3.4#diff-4e3e31cf219d441cb8727ac984998ad07454b20466f6bbb7d380e6a8debe1994 see app/code/Magento/LayeredNavigation/Block/Navigation.php) the change that "fixes" this "bug" is adding in the additional check for the category display mode

$this->getLayer()->getCurrentCategory()->getDisplayMode() !== \Magento\Catalog\Model\Category::DM_PAGE

So in order to have this bug on your site, you would need to modify the canShowBlock method to not check the display mode.

As it is a public function, this can be easily solved with a plugin. https://devdocs.magento.com/guides/v2.4/extension-dev-guide/plugins.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.