How to Create Sitecore Mvc Layout and Controller Rendering

2017/12/152 min read
bookmark this
Responsive image

This blog demo how to create use MVC Layout and Controller with Sitecore Layout and Controller Rendering. The final source you can get from here.

Create a Sitecore Page with MVC Layout and Controller

Create Layout at Sitecore

Set Sitecore location for new Layout file

Set Sitecore Mvc Layout's cshtml file location

Create new DefaultLayout1.cshtml at visual studio

Sitecore Layout Detail

DefaultLayout1.cshtml detail

Create Sitecore Controller Rendering

Add Controller name and action name at sitecore

Create Controller at Visual Studio Mvc Project

Sitecore Page Layout Detail

Change Sitecore page to use different Layout

Layout Detail - add Sitecore Controller Rendering

Device Editor

Select the new Rendering

Sample Controller Rendering

Page use new Layout and new Mvc Controller

Create new Page and Submit via Worlflow

Approve Workflow

Publish and see changes