What are Renderings in Sitecore

Pranay    13 Mar '19    150 views

This post gives details on what renderings are in Sitecore and different types of renderings available in Sitecore. This post also helps you to understand the concept of Layout and Placeholders in Sitecore

Renderings in Sitecore

In Sitecore CMS, every web page is split into multiple pieces/blocks and each of these blocks are rendered/presented by different components (a piece of functionality) separately. Every component is defined with a specific purpose and a functionality.

For example a basic web page can have a header, a footer and page body. In this case, we might have a header component, footer component, page body component

Sample Page layout

Now, each of these components require some logic to present the right content in each of these sections dynamically. This logic which could generate a piece of html dynamically is nothing but a rendering in Sitecore. Once all the renderings are rendered in page, the complete html of the page is generated and could display the web page as required.

In Sitecore MVC, each rendering is nothing but a controller action or even it could be a simple view.

So to create a rendering in Sitecore

  • We should create a rendering item in Sitecore
  • Point this rendering item to a MVC action or just a view from the MVC web application. In the screenshot below, I have chosen Controller rendering .i.e., it points to an controller action in the MVC application.
  • Assign this rendering to the page layout. In our example, a layout can be thought of the html skeleton which holds the header, footer and the page content sections.
  • In order to place the renderings on top of the layout, there are specific sections defined in every layout. These are called as placeholders.

Create Rendering Sitecore

Controller Rendering Sitecore

  • Below is a sample layout which has 3 placeholders.

Sample One Column Layout

I hope this helps you to understand the concepts of Renderings, Layouts and Placeholders in Sitecore. Please comment your thoughts.

If you are looking for a list of all types of renderings in Sitecore this link can help you - Types of Renderings in Sitecore

About the author

Pranay Deegoju
Sitecore Certified Professional

A Software Engineer by profession, a part time blogger and an enthusiast programmer. You can find more about me here.



Leave your comments on this post here


Want more such posts, subscribe here

Recent Posts

×

Liked this article?

Subscribe with your email and get updates when ever a new article is posted.

By subscribing you agree to our privacy terms. We promise that we do not sell your data.