0

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 ? – Rk Rathod Aug 14 at 13:23
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 Aug 14 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. – Mitro Aug 14 at 13:22
  • I did it, but it does not work. – SebastianT Aug 14 at 13:30
  • Check my updated answer – Mitro Aug 14 at 13:35

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.