1

I have added a static block in the category
Static block content: enter image description here Category : enter image description here It shows all the products on a page. toolbar not showing: enter image description here enter image description here

How can I add the toolbar: enter image description here

10
  • check with F12 is causing anything? – Bojjaiah Feb 4 '20 at 9:24
  • what u want to say ? what is F12 – Hafiz Arslan Feb 4 '20 at 9:43
  • Check with browser inspecting element with F12 the toolbar style. – Bojjaiah Feb 4 '20 at 11:15
  • there is empty div of the toolbar. – Hafiz Arslan Feb 4 '20 at 12:48
  • Post your code. then we will look at it. – Bojjaiah Feb 4 '20 at 13:13
1

Check you have set a proper limit to show in sigle pagination

Store >> Configuration >> Catalog >> Catalog >> StoreFront

enter image description here

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
2
  • yes, I have set a proper limit to show pagination. – Hafiz Arslan Feb 10 '20 at 6:22
  • apply my solution it will work – Ketan Borada Feb 10 '20 at 11:39
0

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.

1
  • 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 – Hafiz Arslan Jan 30 '20 at 12:58
0

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;

0

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.

1
  • first, let me check then let u know – Hafiz Arslan Feb 10 '20 at 6:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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