Add external URL to Menu category

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
9 years ago
I created a topic page in nopcommerce 3.5 by going to: Content management>Topics then clicking “Add new”.  I also selected the option to include in top menu.  After the topic is created it also creates a URL for that topic.  Is there any way I can change this URL from the default and have the topic point to an external URL?

Is there an easy way I can achieve this?

Thanks.
9 years ago
Does anyone know how to change the URL from the main menu to point to a URL with a different domain name from that of the nopcommerce site?

Thanks.
9 years ago
mckeevamark12 wrote:
Does anyone know how to change the URL from the main menu to point to a URL with a different domain name from that of the nopcommerce site?

Thanks.


Find /Views/Catalog/TopMenu.cshtml

You can add any url here like bellow

 <li><a href="yoururl">your url text</a></li>
9 years ago
I want the URL to apply to a specific category menu.

Where exactly in the TopMenu.cshtml file do I place the new URL?
9 years ago
-
9 years ago
mckeevamark12 wrote:
I want the URL to apply to a specific category menu.

Where exactly in the TopMenu.cshtml file do I place the new URL?


category sub category menu render dynamically, you can put if else there

@helper RenderCategoryLine(CategorySimpleModel category, int level, bool responsiveMobileMenu)
{
    <li class="dropdown">
      ...

        @{
            var levelClass = "";
            if (level == 0)
            {
                levelClass = "firstLevel";
            }
            if (category.SubCategories.Count > 0)
            {
                <ul class="dropdown-menu @levelClass">
                    @foreach (var subCategory in category.SubCategories)
                    {
                        @RenderCategoryLine(subCategory, level + 1, responsiveMobileMenu)


                    IF sub Category.Name = "your custom url text"
                      {
                         <li><a href="your customer url">your custom url text</a></li>
                       }
                    }
                </ul>
            }
        }
    </li>
....
    <li><a href="yoururl">your url text</a></li>
}
7 years ago
I try this solution, and it does not work. It creates and repeats the same text after each category. By the way I'm working on nopCommerce version 3.8
7 years ago
There was a typo, which would cause the condition not to be met:
IF sub Category.Name = "your custom url text"

should have been

IF subCategory.Name = "your custom url text"
6 years ago
embryo wrote:
There was a typo, which would cause the condition not to be met:
IF sub Category.Name = "your custom url text"

should have been

IF subCategory.Name = "your custom url text"


hey embryo can you help me out to add custom url text?
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.