How to add Custom Menu item and submenu in navigation bar Magento 2?












0














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










share|improve this question
















bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • You can use as metioned in magento.stackexchange.com/questions/95017/…
    – Kishan Patadia
    Feb 16 '18 at 5:37










  • I managed to add a link in the navigation bar. But how do i add submenu item now?
    – Mudz7
    Feb 16 '18 at 6:14
















0














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










share|improve this question
















bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • You can use as metioned in magento.stackexchange.com/questions/95017/…
    – Kishan Patadia
    Feb 16 '18 at 5:37










  • I managed to add a link in the navigation bar. But how do i add submenu item now?
    – Mudz7
    Feb 16 '18 at 6:14














0












0








0







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










share|improve this question















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







magento2 topmenu submenu






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 21 '18 at 11:50









Piyush

4,76872053




4,76872053










asked Feb 16 '18 at 5:30









Mudz7Mudz7

213




213





bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community yesterday


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • You can use as metioned in magento.stackexchange.com/questions/95017/…
    – Kishan Patadia
    Feb 16 '18 at 5:37










  • I managed to add a link in the navigation bar. But how do i add submenu item now?
    – Mudz7
    Feb 16 '18 at 6:14


















  • You can use as metioned in magento.stackexchange.com/questions/95017/…
    – Kishan Patadia
    Feb 16 '18 at 5:37










  • I managed to add a link in the navigation bar. But how do i add submenu item now?
    – Mudz7
    Feb 16 '18 at 6:14
















You can use as metioned in magento.stackexchange.com/questions/95017/…
– Kishan Patadia
Feb 16 '18 at 5:37




You can use as metioned in magento.stackexchange.com/questions/95017/…
– Kishan Patadia
Feb 16 '18 at 5:37












I managed to add a link in the navigation bar. But how do i add submenu item now?
– Mudz7
Feb 16 '18 at 6:14




I managed to add a link in the navigation bar. But how do i add submenu item now?
– Mudz7
Feb 16 '18 at 6:14










3 Answers
3






active

oldest

votes


















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>





share|improve this answer























  • 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.






share|improve this answer





























    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.






    share|improve this answer





















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "479"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f213739%2fhow-to-add-custom-menu-item-and-submenu-in-navigation-bar-magento-2%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      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>





      share|improve this answer























      • 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














      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>





      share|improve this answer























      • 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












      0








      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>





      share|improve this answer














      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>






      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Feb 16 '18 at 5:58

























      answered Feb 16 '18 at 5:56









      SandeepSandeep

      263




      263












      • 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


















      • 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
















      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




      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.






      share|improve this answer


























        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.






        share|improve this answer
























          0












          0








          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.






          share|improve this answer












          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 21 '18 at 11:33









          SandeepSandeep

          263




          263























              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.






              share|improve this answer


























                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.






                share|improve this answer
























                  0












                  0








                  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.






                  share|improve this answer












                  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.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 29 '18 at 18:55









                  Rajbir SinghRajbir Singh

                  216




                  216






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Magento Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f213739%2fhow-to-add-custom-menu-item-and-submenu-in-navigation-bar-magento-2%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      1300-talet

                      1300-talet

                      Display a custom attribute below product name in the front-end Magento 1.9.3.8