Global Office Directory
Share this page
Home > Community > Technical Blogs > John West Sitecore Blog > Sitecore Differentiating Factors Blog Series The Layout Engine
The layout engine differentiates Sitecore from competing web CMS solutions by defining the Sitecore context, abstracting URLs as data elements, storing presentation component configuration in data elements rather than files, applying the rules engine, and through other enhancements to ASP.NET. This blog post about the layout engine is part of a series about Sitecore Differentiating Factors.
The layout engine defines the Sitecore context. The Sitecore context provides information about the request, including the user, language, device, and state (Sitecore Debugger, Page Editor, etc.), as well as the requested site, database, and content item. Because Sitecore uses a pipeline to define the Sitecore context, you can add and override components in the process.
The layout engine abstracts URLs, which correspond to items in a database rather than applications, markup, or code files under the document root. Sitecore represents a relational database as a hierarchy exposed as a simple XML model and API. Most importantly, Sitecore maps URLs to items in the hierarchy rather than letting IIS map URLs to files.
Items contain layout details, which specify standard ASP.NET components to service HTTP requests under different conditions. The layout engine acts as a dependency injection container for presentation components. For each data item or type of item, you can assign different layouts (.aspx) for different types of devices (browsers and mobile clients) and select which presentation components (.ascx, XSL, and controls) the layout engine will bind to each placeholder in each layout. You can even nest placeholders using sublayouts (.ascx). The layout engine provides granular control of data and presentation component reuse across pages, so you avoid duplicating code or content. Each item simply uses whichever data and presentation components you declare through the browser-based UI. I think the layout engine is an area where Sitecore really proves the ROI of web CMS, especially when tied in with the Online Marketing Suite (OMS). The Presentation Component Reference describes the layout engine in greater detail than this post.
The layout engine supports the rules engine, which provides for features such as conditional rendering, multivariate testing, and the OMS. You can use conditional rendering to dynamically alter layout details to add or remove presentation compoents, and to set properties of presentation components, such as assigning a dynamic data source to each control. You can read more about the rules engine in a post titled Sitecore 6.1 Rules Engine and Conditional Rendering on my old blog, and in the Rules Engine Cookbook.
Developers new to Sitecore often confuse the layout engine with ASP.NET master pages. While the Sitecore layout engine can use them, master pages don't provide the same value as the Sitecore layout engine. Among other limitations, master pages don't make it intrinsically easy to share content to multiple devices or update the information architecture of a website, present some challenges related to internationalization, and don't provide a rules engine.
I've been using Sitecore for so long that I don't like to imagine building a web site without the layout engine, so I've probably forgotten additional value derived from the layout engine. Please comment on this post to describe any additional benefits provided by the layout engine.
Next in the Sitecore Differentiating Factors series: Pre-Integration.
Tags: API, Infrastructure, Mobile Web
- Alistair Deneys September 01, 2010 at 2:58 PM
- John West September 03, 2010 at 7:42 AM
John has over ten years of experience in the CMS industry. His areas of focus include the Sitecore community, Web industry research, Sitecore technical documentation, and product management.
This website is designed to be fully functional with scripts disabled in browser. Please contact the webmaster for any suggestions