Close

How to display only on home page top?

gopinath
12 years ago
#1132 Quote
Avatar
  • 3
Hi.

I like to display Nop-JCarousel only on home page top. when i use "Content-Before" as the widgetzone for my slider, then its displaying on every page through the whole application. But i wants it to be displayed only on the Home page, not on the any other pages.  what widgetzone i have to select for it or i have to do any changes manually.? pls guide me...

Thanks in advance.

Regards
Gopinath.K
Support
12 years ago
#1134 Quote
Avatar
  • Moderator
  • 1044
gopinath wrote:
Hi.

I like to display Nop-JCarousel only on home page top. when i use "Content-Before" as the widgetzone for my slider, then its displaying on every page through the whole application. But i wants it to be displayed only on the Home page, not on the any other pages.  what widgetzone i have to select for it or i have to do any changes manually.? pls guide me...

Thanks in advance.

Regards
Gopinath.K


Please use the homepage_top widget zone and this way the JCarousel will be shown only on the Home page. The content_before is a widget zone defined in the master layout, so it is available on every page on your store.
You can define you own custom zone and place it whatever you want on the Home page.
If you want to show it outside the content of the Home page you can define your own section and show it in the _root.cshtml file if it is defined.
@if (IsSectionDefined("YourSectionForJCarousel"))
{
    @RenderSection("YourSectionForJCarousel")
}

Then define the section in your home page Index.cshtml file:

@section YourSectionForJCarousel
{
    @Html.Action("WidgetsByZone", "Widget", new { widgetZone = "home_page_top_jcarousel" })
}

You can see the documentation of the Electronic theme for the Main slider as this is how we place it on the top.

Hope this helps!

Best Regards,
Nop-Templates Support Team