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
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.
- Below is a sample layout which has 3 placeholders.
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