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

asked Aug 14, 2019 at 12:53
1
  • please attach screen shot where you need to display custom block ? Commented Aug 14, 2019 at 13:23

1 Answer 1

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

answered Aug 14, 2019 at 13:03
4
  • Thanks for your answer. But is there a way to do this only with .xml file? Commented 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. Commented Aug 14, 2019 at 13:22
  • I did it, but it does not work. Commented Aug 14, 2019 at 13:30
  • Check my updated answer Commented Aug 14, 2019 at 13:35

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.