Close

Add to Main Menu

summitridgegear
10 years ago
#3868 Quote
Avatar
  • 9
I want to add a new feature to the main menu, i.e. HOME, PRODUCTS, etc. I have been unable to figure this out. I am on 3.2. Any guidance will be appreciated. Of course the new menu item will launch a custom page.
Support
10 years ago
#3875 Quote
Avatar
  • Moderator
  • 1044
summitridgegear wrote:
I want to add a new feature to the main menu, i.e. HOME, PRODUCTS, etc. I have been unable to figure this out. I am on 3.2. Any guidance will be appreciated. Of course the new menu item will launch a custom page.


Hi summitridgegear,

As you know the razor views of all our plugins are open for modifications, so you can easily add any link to the Nop Mega Menu if the link is not present as an option in the administration of the plugin.
In order to do that just open the Plugins/SevenSpikes.Nop.Plugins.MegaMenu/Views/MegaMenu/MegaMenu.cshtml file in a text editor. You will see many <li> elements which represents every link that can be displayed in the menu. So if you want to add any custom link you should add it as a <li> element. For example

<li><a href="{link_to_your_page}">{text_displayed_on_the_menu_item}</a></li>

where you want to be displayed your menu item. The link_to_your_page and text_displayed_on_the_menu_item should be replaced with your link and text for the new item.

For example after the

if (Model.Settings.IncludeContactUsLink)
    {
        <li><a href="@Url.RouteUrl("ContactUs")">@T("ContactUs")</a></li>
    }

code which is for the Contact Us link.

Hope that helps!
summitridgegear
10 years ago
#3896 Quote
Avatar
  • 9
Thanks. This is good info. Now it is giving me an error "Can't find route name....". I know I have to hook my age in somewhere, but can't find where. Excuse me if these are newbie question.
Support
10 years ago
#3897 Quote
Avatar
  • Moderator
  • 1044
summitridgegear wrote:
Thanks. This is good info. Now it is giving me an error "Can't find route name....". I know I have to hook my age in somewhere, but can't find where. Excuse me if these are newbie question.


Hi,

Can you share what route you are trying to use and for what page, so that we can help you what might be wrong. As you know in nopCommerce there are different routes for different pages, so you might be using the wrong one.

Best Regards!