Data Templates Up the Ante

Monday, May 06, 2013 @ 11:55

Handling your Thoughts
By: Scott Gillis, Lead Consultant

I have found that my SharePoint experience allows me to struggle less with the concepts of how Sitecore works, but with the fundamentals of how Sitecore handles and uses my 'thoughts.' Over the next few posts, I will be breaking down the main Sitecore terms and components and explaining them in Sharepoint-ees.

For those who have not read my intro to the series I use the term 'thought(s)' to reference the content/data you are striving to collect and make available in your final web experience.

SharePoint Refresh
Before we begin reviewing Sitecore, let us refresh ourselves with the 'thought' management system used by SharePoint. A quick flyover shows the following major components

+ An item's structure is defined by a Content Type
+
Content Types can inherit from another content type
+ Content Types are made up of columns (also referred to as fields or meta data)
+ Columns have a defined data type limiting the possible acceptable values
+ A created instance of a content type is call an Item (also called list items, pages, document depending of context)

Sitecore basics
In SharePoint, structure begins with a Content Type. The reasonable equivalent in Sitecore is a Data Template. At its root, a data template is just a collection of template fields (or in SharePoint speaks columns. A template field has a specific field type that defines the type of values a user can possibly enter, this works just as a data type does for a column in SharePoint. To keep consistency throughout the 'thought' collection process, it is helpful to have fields auto-populate with common values, which may or may not need to be changed. SharePoint handles this via a default value when defining a column for a content type. Sitecore handles default values at the data template level, and refers to them as standard values.

Sitecore is designed in a manner that 'thoughts' can be easily grouped in a hierarchal manner, which you do not see in SharePoint (this become further obvious as we examine our sample site) but one such feature is the Data Template Section. The data template section provides a nice visual cue, especially for the users entering 'thoughts', grouping related fields together. (On the SharePoint side, unless you spend time creating a custom editing page this type of grouping just does not exist.)

SharePoint does content type inheritance in a linear manner. Suppose you have content type B that inherits the structure of content type A, you then create content type C that is to have the structure of content type B as well as the structure found in content type Z. Since SharePoint will only allow us to inherit from B or Z but not both, and require us to manually, add the structure from the other. On the other hand, Sitecore allows a data template to inherit from any number of other data templates. Sitecore views structure from a hierarchal manner, allowing type C to inherit both B and Z’s structure.

Sitecore’s hierarchal inheritance system allows us to create data templates purely for inheriting structure ‘thoughts’, such templates are called Base Templates.

Sitecore Basics Review

+ A 'thought's' structure is defined by a Data Template
+
Data templates can inherit from any number of other data templates (also known as Base Templates)
+ Data templates are made up of any number of Data Template Sections
+
Data template sections are groupings of Template Fields
+
An instance of a data template is an item.

Comparison Image
For the visual learners here is a diagram showing how SharePoint elements map to Sitecore elements.


Rainfly Roasters (an example of the differences)

Reading about new concepts helps, but I find a good visual example to be the best way to comprehend the differences. The example I will be building on over the course of this series will be a web presences for a fictional coffee shop called Rainfly Roasters.

What is a coffee shop without coffee to roast and delicious products that use it? Our site will display three basic 'thoughts' farmer, coffee, and products.

Step 1: Create the location structure

Farmer

Coffee

Product

Farmer Name

Bean Name

Product  Name

Years of Operation

Farmer

Coffee

Location

Location

 

 

Taste Profile

Taste Profile

You will notice that the farmer and coffee both require field details describing Location because of this we will generate an additional structure called Location that Farmer and Coffee will inherit. A Location will consist of the values for Country/Region, Longitude, and Latitude.

Furthermore, Coffee and Product each share a detail for Taste Profile, since this ‘thought’ structure is shared and we want consistency it will be extracted into another structure consisting of the details Smells Like and Color.

Step 2: Create Taste Profile. This will look similar the location structure as it does not inherit anything.

Step 3: Create the Farmer structure.

Step 4: Create Coffee structure.

Step 5: Create the Product structure. Since this is a single inheritance case, the final will resemble the concepts in step three, the creation of the Farmer structure.

Final Thoughts
When your 'thought' structure has many shared details, Sitecore provides benefits over SharePoint, with the ability to inherit from any number of base templates. In addition, Sitecore provides some very nice visual cues, Data Template Sections, to help break up and categorize the required pieces to be collected for a 'thought'. These differences cause you to look at your 'thoughts' a little different than in the flat/linear approach that SharePoint takes. In creating that perfect web user experience, I think Sitecore's system for building structure has a more natural feel to it.

 

Scott Gillis, Lead Consultant at Paragon and 2017 Sitecore MVP, has been working with Sitecore for several years. He has a deep passion for helping clients leverage their content and data into powerful new capabilities in Sitecore and has produced successful outcomes as the technical lead on numerous, complex implementations. Recently, Scott has been focusing on helping these clients take advantage of the wealth of data collected by Sitecore Experience Analytics.