0

I created a cms page with url key "allproducts", i add a layout.xml cms_page_view_id_allproducts.xml in my theme app\design\frontend\Vendor\Name\Magento_Cms\layout\

here is the content of the layout xml,

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
 <body>
 <referenceContainer name="content">
 <block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="category.toolbar" template="Magento_Catalog::product/list/toolbar.phtml"/>
 <block class="Magento\LayeredNavigation\Block\Navigation" name="catalog.leftnav" before="-" template="Magento_LayeredNavigation::layer/view.phtml"/>
 <block class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list" template="Magento_Catalog::product/list.phtml">
 <container name="category.product.list.additional" as="additional" />
 </block>
 </referenceContainer>
 </body>
</page>

And Error is:

Error: Cannot instantiate interface Magento\Catalog\Model\Layer\FilterableAttributeListInterface in /var/www/example/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:50

but it is not work,do anyone how what is the simplest way to show all products with layered nav?

Charmi Patel
1,2673 silver badges16 bronze badges
asked May 15, 2023 at 7:20

1 Answer 1

0

Yes, it is possible to add a CMS page in Magento 2 that displays all products with layered navigation. Here is a detailed process for accomplishing this task

  • Create a new CMS page: Content > Elements > Pages.

  • Add a block to the CMS page.

  • Configure the static block:

    {{block class="Magento\Catalog\Block\Product\ListProduct" name="custom.products.list" template="Magento_Catalog::product/list.phtml"}}

    {{block class="Magento\LayeredNavigation\Block\Navigation" name="catalog.leftnav" template="Magento_LayeredNavigation::layer/view.phtml"}}

  • Save the static block and CMS page.

  • Ensure that the necessary template files are present:

    Make sure that the template files specified in the template attribute of the block directives are available in your theme or module. In this example, the list.phtml template file should exist in the Magento_Catalog module, and the view.phtml template file should exist in the Magento_LayeredNavigation module.

  • Clear the cache.

Charmi Patel
1,2673 silver badges16 bronze badges
answered May 15, 2023 at 12:31

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.