How to add Custom Menu item and submenu in navigation bar Magento 2?
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
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.
add a comment |
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
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
add a comment |
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
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
magento2 topmenu submenu
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
add a comment |
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
add a comment |
3 Answers
3
active
oldest
votes
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
add a comment |
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.
add a comment |
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.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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>
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>
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
add a comment |
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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Feb 21 '18 at 11:33
SandeepSandeep
263
263
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Aug 29 '18 at 18:55
Rajbir SinghRajbir Singh
216
216
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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