0

I am struggling to add a non-category custom menu in the navigation bar and also a sub-menu. Please help. Thanks.

0

Please find the below code for Main menu and submenus.

<?xml version = "1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="../../../Backend/etc/menu.xsd">
    <menu>
        <!--Main Menu-->
        <update id="Arise_Extensions::menu" title="Arise Extensions" module="Arise_Contact" sortOrder="10"
                resource="Arise_Extensions::menu"/>
        <!-- Sub Section 1 -->
        <add id="Arise_Contact::contacts_manager" title="Arise Contacts" module="Arise_Contact" sortOrder="10"
             parent="Arise_Extensions::menu" dependsOnModule="Arise_Contact"
             resource="Arise_Contact::contacts_manager"/>
        <!-- Sub Section 1 Links-->
        <add id="Arise_Contact::manage_contacts" title="Manage Contacts" module="Arise_Contact" sortOrder="10"
             parent="Arise_Contact::contacts_manager" action="Arise_contacts/manage_contacts"
             resource="Arise_Contact::manage_contacts"/>
        <add id="Arise_Contact::Arise_contacts_settings" title="Manage Contact Settings" module="Arise_Contact"
             sortOrder="20" parent="Arise_Contact::contacts_manager"
             action="adminhtml/system_config/edit/section/Arise_contacts"
             resource="Arise_Contact::Arise_contacts_settings"/>
        <!--/Sub Section 1 Links-->
    </menu>
</config>
  • I want to add the menu item in the home page navigation bar in the frontend, not in the backend. :) – Mudz7 Feb 16 '18 at 6:13
0

one alternative solution is that

create one new category and assign cms block to it

and add cms page code to that cms block

everything works as per you needed.

0

You can try this way:-

Extend this file from core:-

app/design/frontend/<vendor_name>/<theme_name>/Magento_Theme/templates/html/topmenu.phtml

<nav class="navigation" data-action="navigation">
    <ul data-mage-init='{"menu":{"responsive":true, "expanded":true, "position":{"my":"left top","at":"left bottom"}}}'>
        <?php /* @escapeNotVerified */ echo $_menu; ?>
        <?php /* @escapeNotVerified */ echo $block->getChildHtml(); ?>
        <li>Test menu</li>
    </ul>
</nav>

It will add a menu in the end.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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