1

current setup:

  • Magento 2.2.4 installed with composer.

I want to replace the navigation menu with a different navigation menu (MCP Menu Creator Pro). I think I am supposed to extend the magento/module-theme default.xml layout under the Magento_Theme folder in my Pearl/weltpixel/Magento_Theme/

My questions are:

1) how do I find the block name of the navigation block I want to replace? when viewing the home page even with the hints turned on under Stores->Configuration->Advanced->Developer->Debug I am not able to reliably find the block I want to replace

2) I was given this block to add for Menu Creator Pro:

<block class="Magebay\Menupro\Block\Menu" name="menupro_group_1" ifconfig="menupro/setting/enable" template="Magebay_Menupro::menupro/menupro.phtml">
    <action method="setData"><name>groupmenu_id</name><value>1</value></action>
</block>

Honestly, I am not sure where to put this in the default.xml or what to wrap it with (shouldn't there be some reference that tells magento2 to use this nav menu rather than the default?). When looking through the official magento 2.2 docs, it says that <action> is not the preferred element and one should use an <arguments> element set instead!?

Appreciate the help as I begin to understand the magento 2 structure.

note: the Weltpixel_NavigationLinks module included with the Pearl theme has been disabled by

php bin/magento module:disable WeltPixel_NavigationLinks
php bin/magento setup:upgrade
1
  • Two files use for navigation – Sourav Jun 12 '18 at 3:13
0

Two files use for navigation

Magento\Theme\Block\Html\Topmenu.php
Magento\Catalog\Plugin\Block\Topmenu.php
1
  • Is the class name the block name? So for instance the Topmenu.php file contains a class of "Topmenu". I can use "Topmenu" as my block name in references in my xml layout files? – user68323 Jun 14 '18 at 1:01

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.