Search code examples
sitecoresitecore-mvcsitecore8

How do I emulate RenderSection in Sitecore?


I know that sitecore mvc dos't support RenderSection.

Is it any way to emulate it with Sitecore MVC ?

I just would like to have only required scripts for specific page.

Of course I can split it to 2 files and to View Rendering but it is seems not good way.


Solution

  • This is not something that you may do easily. It is all about creating appropriate html helpers for that. Here is previous StackOverflow question describing how to implement that:

    Using sections in Editor/Display templates

    Also this article may help you as well:

    http://tomkamphuis.blogspot.co.uk/2013/04/sitecore-and-mvc-rendersections.html