I have a problem with displaing my custom block in toolbar toolbar-products between sorter and toolbar-amount.
I tried this code:
<referenceBlock name="product_list_toolbar">
<block class="Vendor\Module\Block\CategoriesSiblings" name="categoriessiblings" template="Vendor_Module::categoriessiblings.phtml"/>
</referenceBlock >
in my catalog_category_view.xml but nothing shows.
I can display this block without problems in:
<referenceContainer name="content">
</referenceContainer>
Thanks in advance for any help
-
please attach screen shot where you need to display custom block ?Ronak Rathod– Ronak Rathod2019年08月14日 13:23:15 +00:00Commented Aug 14, 2019 at 13:23
1 Answer 1
Replace you code with following
<referenceBlock name="product_list_toolbar"template="Vendor_Module::categoriessiblings.phtml"/>
You have to add default toolbar.phtml code into your custom template and also you can add your custom element in this template
-
Thanks for your answer. But is there a way to do this only with .xml file?SebastianT– SebastianT2019年08月14日 13:16:47 +00:00Commented Aug 14, 2019 at 13:16
-
Then you need to override the catalog_category_view.xml in you custom module and modify referenceBlock "product_list_toolbar" with your custom template instead of toolbar.phtml.Mitali– Mitali2019年08月14日 13:22:41 +00:00Commented Aug 14, 2019 at 13:22
-
I did it, but it does not work.SebastianT– SebastianT2019年08月14日 13:30:29 +00:00Commented Aug 14, 2019 at 13:30
-
default