In this article, we will show you how to design your first Data template. A Data template is a representation of the data you want to see on screen.
First let’s start by logging into sitecore via Content Editor mode. Content Editor is where you will be spending most of your time developing websites.
After you login you should see the following screen.
Navigate to the User Defined section under Templates. Lets create a Template folder by clicking on the “Template Folder” icon. Give a name of “DemoData”.
Next we will create a Template and Give it name called “SamplePage”.
Select the location to be the DemoData folder we previously created.
You now you have base template that you can start adding fields to. You can group your fields by section, this is mostly for you to organize and group data it is not how you retrieve your data. Lets create a section called header. Under it give it a field called Title and select SingleLine Text field from the options in the dropdown. Continue and add a field called MetaDescription and select MultiLine Text field from the options in the dropdown. Lets add another section called Content, in this section add a field called Body and select Rich Text field from the optin in the dropdown. You should have something that look like the screenshot below.
Next we have to do one of the most important things, and the easiest step to forget. We have to add the standard values to the the template. Under the Builder tab select options.
Click on the standard values button. You should now see the following.
The reason you have to add standard values is for a couple reasons. This is where you can add default values to your data template, when a user creates a new instance of it it will be pre populated with the default values that you added. Standard values is also where you configure assignments rules and security. With the standard values node selected click on the configure tab, and then assign.
This assignment rule allows us to create SamplePages under sample pages, in essence you can create a hierachy of pages. Expand the content node and right click on the Home node, select Insert Sample Item and name it Page1.
This page won’t be able to display since we have not assigned layout to it. If you navigate to it you will get a 500 error saying there isn’t a layout assigned to it.