So for building this blog, I've decided to use mostly built-in core properties and one notable exception. I'll be using Archetype to build the blog articles as 'modules'. We won't cover how to get the data out of the data types just yet, we'll save that for the next part of the series. For now let's just examine a few document types and their data types.
Error pages are boring and usually need some sort of message and in my case, a particular HTTP status code to send to the browser. Examine the image below, you'll notice we've added only two data types (properties) to the document type:
The two data types we selected come pre-configured when you install Umbraco. If a particular data type has options (like the Richtext editor), you can create a new 'instance' of that data type and change the options to suit your needs for a particular document type. If you install a new data type (also called property editor), it will appear in this list usually only after create a new instance of it.
It's usually normal that document types have data types, but for this blog out of the many document types that I created, only three have actual data types on them. Why you ask? Because it's not required that you render your template from properties on a document type. In fact most of my document types will just use static templates. If I want to be able to edit these pages without editing the templates, I'll need to add data types to the document type and then map them to my templates. Since I'm the only one editing this site for now, it's certainly a tradeoff I'm willing to make.
These document types have no data types (presently) along with some possible future properties:
- BasePage - Maybe add some SEO fields one day.
- AboutMePage - Maybe convert text on page to RTE one day.
- ContactFormPage - Maybe add form settings, like where to send submissions.
- SearchPage - Maybe add number of results per page.
These document types have some data types configured:
- ErrorPage (see image above)
So why have so many document types without data types, why not reduce it down? I'm hoping that in the future that if the need arises that I need to edit a page frequently, I already a have document type that represents the type of page I need to edit. For example, if in the future I need to add a property to the AboutMePage, a place to put it already exists. Additionally, I subscribe to the idea that one document type = one template. Though Umbraco allows you to map many templates to one document type, that is just how I normally operate. Every now and then an edge case will appear and I'll map a couple to one. Getting a page to market fast typically means you start with static templates and then wire each one to an Umbraco document type one by one.