Umbraco Basics: Document Types (Tabs, Properties, Structure and Data Types)

Right – so we’re playing with Umbraco, and watching some facinating videos online, and we thought we’d share our pain with you here and tell you something about Document Types (don’t get me wrong, as CMS’s go Umbraco is pretty sweet).

So what are document types? Well together with Templates they form the core building blocks of Umbraco (Templates are covered later) – and whereas Templates defines the look and feel of a page, then the Document Type defines the data available to the page. Really you can think of it as a database table that you define for a certain type of pages.
The data you define is what users can edit when working with pages of that type through the CMS. So think of them as blueprints or specifications for pages – defining the data that the Editor users will be asked for when creating new pages of that type.
Some examples of document types could be “HomePage”, “StandardContentPage” or  “ArticlePage”,  “you name it” – I think is the general idea.

So, how is this done?
Well, it’s done through Generic Properties which each have a data type. Properties are in turn grouped into Tabs which provide a logical grouping for properties in the edit interface.
Note that Properties all come with a set of meta data which really constitute the information you would normally glean from looking at a data table definition. This meta data includes Name, Alias (unique to the tab), Type (the data type) and of course the Tab which the property belongs to (required).

So, Tabs we have already touched on. Each document type can have one or more of these – effectively grouping the properties. Often you will find that these will correspond to the functional areas on your page layout (so for example MainContent, LatestNews, FooterInfo – etc).

Next we have Structure information. This defines the hierachy of the Document Types (that again constitute the building blocks of your site). Here you can define which Document Types can be nested below others – this is termed “Allowed child nodetypes”.

And finally – thou first in the Document Type editor interface, we have the Info meta data.
This is just plain old descriptive information for your Document Type, like it’s name, icon, description – and the allowed Templates. Again, we will cover Templates in a tick – but for now just realise that Document Types are data definitions, this data can of course be showed in more than one way – and for this reason it is also possible to specify one or more “Allowed Templates” – i.e. one or more ways that the data (document type) can be displayed on the frontend.

One final aspect to touch on is the Data Types of the Generic Properties. There are a long list of built in datatypes like number, textstring, Rich Text etc. Most of which funnily enough are listed not by type, but by the control type they are represented by in the editor interface (so we have for example a Rich Text Editor data type).
Interestingly (and no doubt important) you can create your own custom data type by choosing a name and a base type (from Date, integer, Ntext and NVarchar). So, just to clarify – what this does is it allows you to present the editor with a control that allows them to select from a specific data type you defined.

No doubt we will have more fun with Data Types later on. For now, let’s move onto Templates


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: