Close

How to add additional items to menu

pdesignz
12 years ago
#1349 Quote
Avatar
  • 40
I am wondering how I can add additional items to the menu. I looked at the documentation and was able to follow and add an additional topic as instructed. This was not a problem,  but I was then wondering how can I add an additional item to the menu and also not have a drop down or submenu be displayed, just looking for an additional link to the menu.

Thanks
Support
12 years ago
#1352 Quote
Avatar
  • Moderator
  • 1044
Hi pdesignz,

You can easily add any other links in the menu in the same way like you have added a new topic. Open the MegaMenu.cshtml view as stated in the documentation and in the <ul> add a new <li> element with the link.

For example if you want to add a link to the forum, just add the following line of code inside the <ul> element:

<ul>
...
...
<li><a href="@Url.RouteUrl("Boards")">@T("Forum.Forums")</a></li>
...
...
</ul>

If you need any further help please let us know!

pdesignz
12 years ago
#1356 Quote
Avatar
  • 40
Thanks for the info, I do have a question about your link.
<a href="@Url.RouteUrl("Boards")">@T("Forum.Forums")</a>
I see "Boards", can I use anything there or does this have to be something specific
Forum.Forums, how would I find out what I need to use here? For example if I wanted to use About US, or a topic or custom page.

I also noticed that there are if statements in use, such as
@if(Model.Settings.IncludeHomePageLink)
@if (Model.Settings.EnableCategories)
@if (Model.Settings.EnableMegaMenuTopic)

Would I need to use something like this and if so, how do I know what use after settings.

Thanks
Support
12 years ago
#1357 Quote
Avatar
  • Moderator
  • 1044
Hi,

You can use whatever link you like. It does not matter if it is a hard-coded link, a link built from an mvc route or from an action. It just needs to be in a <li> element. So for example you can add something like this:

<ul>
...
<li><a href="http://www.mysite.com">My Site</a></li>
...
</ul>

If you want to use a topic, you can see the documentation for the plugin and use the "TopicBlock" action.

As to the settings, you do not need to bother about them - these settings are taken from the administration of the Nop Mega Menu so that the correct links are rendered depending on the options enabled in the administration of the plugin.

But as your custom links will not have any administration, you do not need to take into consideration any settings.

Hope that helps!
pdesignz
12 years ago
#1452 Quote
Avatar
  • 40
If I wanted to have additional sections with dropdowns or submenus would the submenus be within the li element. Here is an example and wondering if this would work for an additional item on the menu as well as submenu when you hover over that item on the menu.

<ul>
<li><a href="http://www.mysite.com">Section Header</a>
<ul>
<li><a href="http://www.mysite.com">Submenu #1</a></li>
<li><a href="http://www.mysite.com">Submenu #2</a></li>
<li><a href="http://www.mysite.com">Submenu #3</a></li>
</ul>
</li>
</ul>

thanks
IvanStoyanov
12 years ago
#1453 Quote
Avatar
  • 269
pdesignz wrote:
If I wanted to have additional sections with dropdowns or submenus would the submenus be within the li element. Here is an example and wondering if this would work for an additional item on the menu as well as submenu when you hover over that item on the menu.

<ul>
<li><a href="http://www.mysite.com">Section Header</a>
<ul>
<li><a href="http://www.mysite.com">Submenu #1</a></li>
<li><a href="http://www.mysite.com">Submenu #2</a></li>
<li><a href="http://www.mysite.com">Submenu #3</a></li>
</ul>
</li>
</ul>

thanks


Hi pdesignz,

This will work if you remove the first <ul>.
Your code should look like this:

<li>
<a href="http://www.mysite.com">Section Header</a>
<ul>
<li><a href="http://www.mysite.com">Submenu #1</a></li>
<li><a href="http://www.mysite.com">Submenu #2</a></li>
<li><a href="http://www.mysite.com">Submenu #3</a></li>
</ul>
</li>


Best regards,

Ivan Stoyanov
Thank you for choosing our products! Your feedback is important to us!
pdesignz
12 years ago
#1455 Quote
Avatar
  • 40
Do I need to apply an Id or class to the ul as when I added as is the ul section just displays as a list item and is not hidden and does not show as drop down on hover as the other section does on hover

Thanks
pdesignz
12 years ago
#1456 Quote
Avatar
  • 40
Thanks! I see that there are additional div's (dropdown, box and title)that make it all come together
baloghc
9 years ago
#9395 Quote
Avatar
  • 79
pdesignz wrote:
Thanks! I see that there are additional div's (dropdown, box and title)that make it all come together


I got to the step in your previous post, but what did you have to do with these additional div's to make it all come together?
Nop 3.7 - ArtFactory
Nop 4.0 - Lavella, Venture, Smart, ArtFactory
tamchu
9 years ago
#9860 Quote
Avatar
  • 26
Dear Sir:

What if I want to setup different menu topics for different cart but using the same theme? I don copy the theme to different theme, should I change the file in the copied folder? The version we bought is multiple version, thanks!