Editing menu (top menu or main menu)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Most theme and the free theme of nopcommerce v3.8 have a main menu that is generated automatically. If I want to remove some of the links it contains and maybe edit their names, how can that be done easily ?
7 years ago
revorealm wrote:
Most theme and the free theme of nopcommerce v3.8 have a main menu that is generated automatically. If I want to remove some of the links it contains and maybe edit their names, how can that be done easily ?


Generally, the main menu includes a list of categories. So you can edit category name to change topmenu item names.

If you want to remove it from topmenu then you have to unchecked Include in top menu

i.e: Computer category appears on top menu and you want to remove it from there, then go to

Admin > Catalog > Categories > Computer > Edit > find Include in top menu and Unchecked it

Save it and check!
7 years ago
Well that's a start, thanks for the answer.

I'd like to go way beyond that actually, like I said : how can I customize the main or top menu they way I want it to be and maybe add custom links to pages that I would create.

How can I remove auomatic inclusions like "new products" or "home" in the top menu.
7 years ago
revorealm wrote:
like I said : how can I customize the main or top menu they way I want it to be and maybe add custom links to pages that I would create.


I couldn't found a single world with customize into the question really!
But anyway, you can create topic page and add URL for it on TopMenu.cshtml

For Example: Create a simple topic page with the name HomePage and add URL of that page on Nop.web > Views > Catalog > TopMenu.cshtml:


    @foreach (var topic in Model.Topics)
    {        
      if (topic.Name == "HomePage")
      {
         <li><a href="@Url.RouteUrl("HomePage")">@T("HomePage")</a></li>
      }
    }


Side notes: There will another ways to do a same thing!
7 years ago
Made some tests with the file you pointed me to but it seems I cannot remove the link in the top menu.

For example, by commenting out those lines

    
 //no categories or topis to display? in this case let's diplay some default menu items (should we?)
        /* <li><a href="@Url.RouteUrl("HomePage")">@T("HomePage")</a></li>
        if (Model.NewProductsEnabled)
        {
            <li><a href="@Url.RouteUrl("NewProducts")">@T("Products.NewProducts")</a>
            </li>
        }
        */

      


I would expect the top menu to change by removing the Home page link and also the new product link but it doesn't seem to change anything.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.