I have added a static block in the category
Static block content:
Category :
It shows all the products on a page. toolbar not showing:
4 Answers
Check you have set a proper limit to show in sigle pagination
Store >> Configuration >> Catalog >> Catalog >> StoreFront
wrap layout in on container
<block class="Magento\Catalog\Block\Product\ListProduct" name="category.products.toolbar" as="product_toolbar" template="Magento_Catalog::product/toolbar.phtml">
<block class="Magento\Framework\View\Element\RendererList" name="category.product.type.details.renderers2" as="details.renderers">
<block class="Magento\Framework\View\Element\Template" as="default"/>
</block>
<action method="setToolbarBlockName">
<argument name="name" xsi:type="string">product_list_toolbar</argument>
</action>
</block>
- Call one phtml file in static block
- call toolbar by childhtml in newly created phtml file
I assumed that you have to add some content to category top and bottom of product list so you can create CMS static block and include in list.phtml file. It will fullfill your requirement.
-
every category have different static blocks, its shows the content top and bottom also shows products but products pagination not showing ,as I ask in question .all products shows on one page Jan 30, 2020 at 12:58
First you check website inspect using your pagination part add z-index css style. An element with greater stack order is always in front of an element with a lower stack order. after you can arrange css style using to proper view Example: z-index: -1; or z-index:initial; or z-index:auto;
In order to do this, you would need to put a nested block in your admin static block, but this is not possible in CMS pages or admin static blocks.
In order to achieve this, you can try this:
Create a new layout file in your theme's Magento_Catalog
folder.
app/design/frontend/{vendor}/{theme}/Magento_Catalog/layout/catalog_cms.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block class="Magento\Catalog\Block\Product\ListProduct" name="category.products.list" as="product_list" template="Magento_Catalog::product/list.phtml">
<block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="Magento_Catalog::product/list/toolbar.phtml">
<block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/>
</block>
<action method="setToolbarBlockName">
<argument name="name" xsi:type="string">product_list_toolbar</argument>
</action>
</block>
</referenceContainer>
</body>
</page>
Note that this is copied from Magento's default category layout catalog_category_view.xml
, so if your theme changes this, you might want to check your theme's layout file instead and make adjustments if necessary.
After that, you should be able to call this new layout in your admin static block like this:
{{layout handle="catalog_cms"}}
I haven't tested it, but it should output a product list with a pager on top.
F12
is causing anything?F12
the toolbar style.