Sitecore controller rendering simple example



I think the trick to go about setting up a project for this are :

a) Add reference to Sitecore.kernel and Sitecore.Mvc manually

b) Create a blank project and as you add "Empty Controller", the required folders will be added for you

c) Manually copy .dll to your Sitecore 9 project.






Creating your controller code base 

Create your controller just like how you would do it for asp.net, which means you create controller, model and view.

Model 




Controller 




View




Integrating it to the code layout in sitecore - all you need is @Html.Sitecore().Rendering







Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm