However, presentation logic should be thought of as more than a bunch of individual values. There are relationships between the fields being displayed. You're not just displaying the title of a book along with its cover. You are displaying details about a book. Today it's the title and cover. Tomorrow it might also include a summary of the book.
A block of presentation logic in Sitecore is defined using a component called a "presentation control". In this post I am going to give a quick overview of presentation controls.
What is a presentation control?
A presentation control allows presentation logic to be defined in a reusable component. Some examples are:
- Book detail - displays the title, author, summary and price of a book along with an image of its cover, positioned in a certain way
- Breadcrumb trail
- Ad block - displays an image and a hyperlink
- Header block - displays an image, search box, an ad block and a home link
What are the benefits to presentation controls?
One benefit of using presentation controls is that your presentation logic is encapsulated in a reusable component.
Another benefit is that content editors are able to use the Sitecore page editor to drop presentation controls into their web pages. This is a very powerful tool that can be offered to content editors, and one that I will cover in a future post.
This is not so much a benefit of presentation controls so much as a benefit of Sitecore. There is no new, proprietary technology that you need to learn in order to create presentation controls. You can use .NET or XSLT.
I spent many years teaching people how to use a product that depended on an unwieldy, proprietary language for presentation logic. It's definitely to Sitecore's credit - and the benefit of people learning Sitecore - that they decided against reinventing the wheel.
What's next?
My next post will take a look at some of the technical details of presentation controls. How are they written? What do they look like? How are they used?
Want to learn more?
Sublayout = ASP.NET User Control
ReplyDeleteWebcontrol = .Net server control class that inherits from Sitecore.Web.UI.Webcontrol
Thanks for your post.