Hello,
I think this will help you:
The best and easiest way is to add custom widget zone in your SupportedWidgetZones.xml file in the Anywhere Sliders plug-in folder.
Name it as you wish. Example: <WidgetZone>your_widget_zone</WidgetZone>
Now, go to your _ColumnsTwo.cshtml file and place this code where you want to see the slider:
@{
var controllerName = Url.RequestContext.RouteData.Values["controller"];
if (controllerName != null && string.Compare(controllerName.ToString(), "Home", StringComparison.InvariantCultureIgnoreCase) == 0)
{
@Html.Widget("your_widget_zone")
}
}
// Now via the class "activeTopLevelCategory" you can style your active category.
var path = window.location.pathname;
$('.mega-menu a[href="' + path + '"]').parents('.mega-menu > li').first().addClass('activeTopLevelCategory');
Hello,
You can do this by following these steps:
1. You must call the widget zone for the sliders only in your Index.cshtml file, putting its result in a section like this:
@section MainSlider
{
@Html.Widget("home_page_main_slider")
}
@if (IsSectionDefined("MainSlider"))
{
@section MainSlider_UpperLevel1
{
@RenderSection("MainSlider")
}
}
@if (IsSectionDefined("MainSlider_UpperLevel1"))
{
@RenderSection("MainSlider_UpperLevel1")
}
@section MainSlider
{
@Html.Widget("home_page_main_slider")
}
@if (IsSectionDefined("MainSlider"))
{
@section MainSlider_UpperLevel1
{
@RenderSection("MainSlider")
}
}
@if (IsSectionDefined("MainSlider_UpperLevel1"))
{
@RenderSection("MainSlider_UpperLevel1")
}
@{
var x = Url.RequestContext.RouteData.Values["controller"];
@* var x = this.ViewContext.RouteData.Values["controller"]; You can use both this and the upper row to get the controller name *@
}
@if (x != null && string.Compare(x.ToString(), "Home", StringComparison.InvariantCultureIgnoreCase) == 0)
{
@Html.Widget("home_page_main_slider")
}
<img title="" alt="" src="@Url.Content(logoPath)">
Hello,
We know the good practices used over the web for better SEO. But we still need to follow the nopCommerce model.
Yes, the article you have found is maybe one of the best solutions for faster JS loading and Yes, it can be used in nopCommerce.
You may suggest this JS approach both to our user voice portal and to nopCommerce.
Best Regards !