Understanding How Pages Are Rendered in Sitecore
Layouts are the general framework for a page and sublayouts are what you use to set the display of the page. A layout will contain sublayout and placeholder tags, allowing you to place sublayouts. The difference between these two tags is that sublayout tags are used to place a specific sub layout in a specific place on a page, where placeholder tags define a space in the page that can have sublayouts placed into it via the CMS interface. These sublayouts are the components that do most of the rendering of content to pages.
How Displayed Pages Are Personalized
Sitecore allows you to personalize display components by applying rules to them and then changing something about them. When setting presentation details in Sitecore, we tell it to “use this specific sublayout in this specific placeholder”. This is a basic step in personalization, but Sitecore allows you to go further.
In Sitecore, the context item is the item that corresponds to the URL for the page that has been requested. A behavior that we can set is to display a specific piece of content in the sublayout, instead of the “context” one. This is done by setting a datasource for the presentation component. A datasource is a content item in Sitecore that a user can designate as the source of content for a presentation component.
The next step is to establish rules to determine what to display. Based on the rules that you set, it can perform an action such as setting a datasource, choosing another presentation component, etc. The format of a rule looks like “if X condition is met, perform Y action”.
The conditions are what allow us to perform personalization. They let us look at information about our site visitors like what country they’re in, their behavior on our site, where they fit in our marketing plan, etc. The action is a combination of which sublayout to show, and which piece of content to use a datasource and display. Using personalization in Sitecore, you can show one specific piece of targeted content, or you can change the entire look altogether.
To see a quick demo personalization setup, check out our previous blog post Setting Up Personalization in Sitecore.