Old Site

This site is archived. I now update and maintain my blog here.

Ferguson Moriyama and Umbraco 5

Before I begin, a dedication - I wouldn't have got through this blog post unless I had the wonderful Matt Brailsford, Doug Robar and Sebastiaan Jansen as Skype contacts - these guys are MVP for a reason! #h5yr

Yesterday I started to build the new Ferguson Moriyama website in Umbraco 5, and as promised in my previous blog post I've documented the process.

I've started out by designing the document types for the new Ferguson Moriyama site as I usually would. As people maybe following this as a tutorial I've done a better job of documenting these than I usually would for a normal internal project.

The document types are deliberately as minimal as possible my current site suffers from bloat where I put in fields for edge cases that never emerged - things like alternative titles to be used in place of node names and alternative dates to be used in place of the default publish date. This time I'll start with as little as possible and build up. I'm told that deletion of document type properties in Umbraco 5 is recoverable by rollback which is great in terms of being agile with your document types.


(You can click on the image above to view the Google document that I created)

As an aside I'll talk a little about my process. The document above is expected to change during the process of the build. I'm a firm believer in agility and in fact I believe it is almost impossible to specify exactly what you want before you start building. As I already mentioned, on a typical project I wouldn't maintain such a document. I see Umbraco document types as "self documenting" and for clients who demand formal specifications I'd normally just generate the documentation from the real Umbraco document types. Interestingly (possibly) this is how PDF creator for Umbraco came into being.

The document above contains a few areas which are TBD (to be determined) but I deliberately make assumptions based on Umbraco 4 knowing that I can return later as my knowledge of version 5 increases.

Creating the document types

So I head off to the settings section of Umbraco 5 armed with my document type specs and everything looks reassuringly familiar.

I hesitate slightly creating a document type called Master because it sounds a little too generic and has some connotations of .net master pages but I let it slide. As an aside I'd normally put a site specific prefix in front of my document types but in this case I'm confident that this instance of Umbraco will only ever host the Ferguson Moriyama site.

The first new feature that I notice is stricter control over document type inheritance; I like that by checking Inheritable Only on the Composition tab that I can say that this document type cannot be directly created as an instance of a node. Being a pedant I'm also pleased to see the Generic Properties tab is now called General Properties :)


After 30 minutes or so of playing, Umbraco 5 looks to be in a satisfyingly familiar state. I hit one or two snags - the one that sticks in memory is that I couldn't add properties to inherited tabs but I am told that this is just a temporary glitch.

Create some nodes

Document type hierarchy all worked in a familiar way - I headed over to the Content section and created a Document of type Home with two child nodes of type Text Page.

Again, everything is looking pretty much as I'm used to.


Add some templates

For now I decided to just add a Home Page template and output a property or two, then I'll move on to versioning what I've built to date. No CSS or anything to make the pages look pretty yet, just some ugly markup.

Associating templates with document types is again a very familiar experience to those of you who are familiar with Umbraco 4 - the big difference comes when creating templates, which are no longer master pages but Razor views.

I spent a bit of time messing around here, and I understand that some of the objects exposed to the view by default are subject to change.

Umbraco 5 has a default template (or View) called _Layout.cshtml which is in ~/Views/Umbraco this is synonymous to a Master page in Umbraco 4 and will be familiar to those who have adopted ASP.net MVC prior to looking into Umbraco v5. I'm not sure if it is bad from to modify the default view but I do so.

At this stage I'm finding the terminology a little confusing, the Umbraco 5 UI still uses the terminology master and template -I guess to remain familiar to Umbraco 4 developers but there is a bit of internal conflict as my mind thinks about Views.


I end up with the following layout which does a few familiar things:

Back it up

So I've achieved a lot in a short space of time but before I go I want to make sure that my customisations to Umbraco 5 are versioned and separated in a way that I can roll them out to a new version of Umbraco or revert to a previous version should I break anything.

Or maybe not

I take a precursory glance over the database and the file system and it isn't easy to figure out how document types are stored. I find some information relating to my document types in a table called AttributeSchemaDefinition but the data model uses GUIDs as identifiers and there appear to be some quite complex relationships between the tables. It certainly isn't a 5 minute job to work out how it all hangs together.

My Umbraco HQ contacts aren't on Skype and I feel like I've harassed them enough for today so I decide to quit for the day.

For now I'll backup my SQL CE database - after all it is just a file - and I'll come back to this later when I have a bit more energy. I'm really hoping that moving document types between instances was a design consideration of Umbraco 5. Perhaps this is where Courier vNext will come into play?

Next Time

I'll look at adding CSS and JavaScript to Umbraco 5 and completing my homepage. I'll also look into how to create my top navigation.


Leave a comment