Close

MENU LINK NOT WORKING ON CLICK

tamchu
8 years ago
#9916 Quote
Avatar
  • 26
Dear Sir:

I have add a button call "Our Customer" of which should link to the Topic Page, in the site(http://vic0147.cherryretail.com/), when I click the link, it would open the topic page, but if I open the link in new page, it do open the page, I didn't modify any code, just simply add a topic and set Include in top menu!
iliyan.tanev
8 years ago
#9923 Quote
Avatar
  • Moderator
  • 347
Hi,

To add a topic in MegaMenu you need to open Plugins\SevenSpikes.Nop.Plugins.MegaMenu\Views\MegaMenu\MegaMenu.cshtml view and at the bottom of the file you will see commented section containing something like this:

@*
        This shows hard-coded About Us and Contact Us menu items
        @Html.Action("TopicBlock", "MegaMenu", new { systemName = "AboutUs", enableDropDown = !isMegaMenuResponsive })

        @Html.Action("TopicBlock", "MegaMenu", new { systemName = "ContactUs", enableDropDown = !isMegaMenuResponsive })
*@


The 

@Html.Action("TopicBlock", "MegaMenu", new { systemName = "ContactUs", enableDropDown = !isMegaMenuResponsive })


is the way you add topic links in the mega menu. Just uncomment the section or if you want only one of the links, place the above line below the commented section. 

Also, we have the entire process described in our documentation, in the Add Topics section.

Hope this helps!
Regards,
Iliyan Tanev
Nop-Templates Dev Team
tamchu
8 years ago
#9930 Quote
Avatar
  • 26
Dear Sir:

I do have the code at the bottom, please see below code I copy from the file, actually, I can use a new page to open the link from the button, just if you click on the button, not response, means the link is there!

CODE:

@*
        #TOPICS IN DROPDOWN: You can comment the code above and uncomment this in order to have all topics in dropdown!




        if (Model.Topics.Count > 0)
        {
            <li>
                <span class="with-subcategories labelForNextPlusButton" title="Topics">@T("SevenSpikes.MegaMenu.TopicsTitle")</span>
                <div class="plus-button"></div>
                <div class="sublist-wrap">
                    <ul class="sublist">
                        <li class="back-button">
                            <span>@T("SevenSpikes.MegaMenu.ResponsiveBackButton")</span>
                        </li>
                        @foreach (var topic in Model.Topics)
                        {
                            <li><a href="@Url.RouteUrl("Topic", new {SeName = topic.SeName})" title="@topic.Name">@topic.Name</a></li>
                        }
                    </ul>
                </div>
            </li>
        }
    *@




    @*
        This shows hard-coded About Us and Contact Us menu items
        @Html.Action("TopicBlock", "MegaMenu", new { systemName = "AboutUs", enableDropDown = !isMegaMenuResponsive })




        @Html.Action("TopicBlock", "MegaMenu", new { systemName = "ContactUs", enableDropDown = !isMegaMenuResponsive })
    *@




    if (Model.StickyCategory != null)
    {
        <li class="sticky-category">
            <a href="@Url.RouteUrl("Category", new { SeName = Model.StickyCategory.SeName })" title="@Model.StickyCategory.Name">@Model.StickyCategory.Name</a>
        </li>
    }




    @Html.Widget("header_menu_after")
}
iliyan.tanev
8 years ago
#9934 Quote
Avatar
  • Moderator
  • 347
Hi,

If this is how your view looks like you shouldn't see the links appearing in the menu.
These signs  @*...*@ mean that everything between them will be ignored and won't be compiled. 

In your case you should change this:

 @*
        This shows hard-coded About Us and Contact Us menu items
        @Html.Action("TopicBlock", "MegaMenu", new { systemName = "AboutUs", enableDropDown = !isMegaMenuResponsive })

        @Html.Action("TopicBlock", "MegaMenu", new { systemName = "ContactUs", enableDropDown = !isMegaMenuResponsive })
    *@


to this:


        @Html.Action("TopicBlock", "MegaMenu", new { systemName = "AboutUs", enableDropDown = !isMegaMenuResponsive })

        @Html.Action("TopicBlock", "MegaMenu", new { systemName = "ContactUs", enableDropDown = !isMegaMenuResponsive })


Please write back with your results after the change.
Regards,
Iliyan Tanev
Nop-Templates Dev Team