Wednesday, January 6, 2010

Content Modeling With Sitecore

One of the first technical topics you encounter when learning Sitecore is how the system separates content from presentation. In some ways this is a massive and complicated topic. There are so many options and approaches that can be used.

At the same time, its essence seems to be pretty simple. Not simple in that it should be easy for anyone to understand or that it can be learned quickly. I mean simple in the sense that there isn't much to it. Yes, Sitecore provides a large number of tools for a developer to use to model content and design presentation, but there's a distinct logic and consistency to it. Once you're able to get your head wrapped around that, the system isn't as overwhelming.

New York's original telephone system provides a good metaphor.

If one of the first things you learn is how Sitecore separates content from presentation, probably the very first thing you learn is how Sitecore models content. How does a developer configure Sitecore so content authors are able to create content on the site?

How is content described?
Data Templates are used to model content. A data template is a collection of "fields", with each field representing a specific piece of content. Data templates are used to create "items". An item provides the ability to save specific values for the fields. Each item is based on 1 and only 1 data template. To use an object-oriented programming analogy, data templates are classes and items are instances of those classes.

Fields from a data template at they appear in Sitecore.

For example, you might create a data template for a book. A book has fields to store a title, author, description, image and price. Each book item has its own title, author, description, image and price. Examples of book items are "Crime and Punishment", "Absurdistan" and "Sum" (which are 3 of the best books I read last year).

This is a simple example. In the real world, content is often much more complicated. What if you need to model all sorts of books, with each type of book having different content requirements. For example, the content for a novel might be very different from that of a journal or a reference volume or a technical manual.

The way a WCM system provides handles content like this (meaning there are similarities along with differences) impacts so many different aspects of the system that it's hard to overstate its significance. When a WCM doesn't do a good job, usability suffers, it becomes more difficult to introduce changes, duplication starts to appear, among other things. And all of these things increase the cost of building and maintaining your website.

What's next?
In my next post I will explore the concept of inheritance as it pertains to modeling content with Sitecore. I am impressed with how Sitecore allows developers to use inheritance to create a content model that is easy to develop, maintain and use.

Want to learn more?

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.