Close

Hide Homepage in Megamenu

drcomputer
11 years ago
#2142 Quote
Avatar
  • 33
I need to Hide homepage control in megamenu on homepage. I need Homepage control in other pages. How can be done
Boyko
11 years ago
#2143 Quote
Avatar
  • 1570
drcomputer wrote:
I need to Hide homepage control in megamenu on homepage. I need Homepage control in other pages. How can be done


Hi drcomputer,

This will require several changes.
1. Modify the Mega Menu view and add a css class "home" to the Home page link li element.
Here is the view file:

Plugins\SevenSpikes.Nop.Plugins.MegaMenu\Views\MegaMenu\MegaMenu.cshtml

Here is the code:

@if (Model.Settings.IncludeHomePageLink)
        {
            <li class="home">
                <a href="@Url.RouteUrl("HomePage")">@T("HomePage")</a>
            </li>
        }


2. Create a new css file that will contain the "home" class properties.

.mega-menu .home
{
display: none !important;
}



3. Link the file in the Views\Home\Index.cshtml file.
Html.AppendCssFileParts("~/the path to your file here/homestyle.css");


This way the Home link will not be displayed only on the home page as the styles that hide it will be loaded only on the Home page.

Hope this helps!
Regards,
Nop-Templates.com Team