0

I'm trying to extend the topmenu.php block to make some modifications but it doesn't work for me.

I already created my custom module.

Can someone help me by explaining how I can do it?

1 Answer 1

1

First Of all, you need to assign your create block into the layout default.xml

<referenceContainer name="page.top">
      <block class=“Vendor\Module\Block\Html\Topmenu" name="catalog.topnav" template="Magento_Theme::html/topmenu.phtml" before="-"/>
    </referenceContainer>

I hope this is helpful to you!!

1
  • Hello, it's the topmenu.php file, not the .phtml Jul 7, 2020 at 22:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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