TeamSite features I’d like in Umbraco #1 FormAPI

I’ve been working with Interwoven TeamSite for several years now. For those of you who aren't familiar with TeamSite it is a commercial “Enterprise” content management system (Note: the inverted commas – I don’t like the term enterprise as it is so often misused).

In the last few years I’ve also started working with Umbraco. More often than not, Umbraco is my product of choice when building a content-centric website. In most cases TeamSite is overkill requiring significant hardware to host the content repository not to mention an outlay of tens/hundreds of thousands of pounds in license fees depending on the components of the Interwoven product suite that are required. I’m not saying that there is no case where TeamSite is the solution but for most freelance clients that I have Umbraco is free and more than sufficient.

But… Well, there has to be a but or there is no blog post to make. Every once in a while I hit a problem in Umbraco where I wish I had the TeamSite solution available. Luckily Umbraco is completely open and extensible so I’m canvassing opinion here to see whether anyone shares my enthusiasm for developing an Umbraco solution to an all too common problem.

We’ve all encountered the need for complex form validation when using a CMS before. Let’s take this TeamSite form as an example:

TeamSite

Above you can see that Title and Subtitle are both required fields but what I really want is to have to specify one field or the other. TeamSite provides a JavaScript library called FormAPI which allows me to implement this requirement  with a simple script:

IWEventRegistry.addFormHandler("onFormInit", function() {
		IWEventRegistry.addItemHandler ('/press-release/head/title', 'onItemChange', function(item) {
			var subTitle = IWDatacapture.getItem('/press-release/head/subtitle');
			subTitle.setRequired((item.getValue().length ==0));
		});
	});

The code above adds a handler to my Title field which is called when the value changes. The required status of the Sub Title field is then set dependent on it’s value.

Simple example, but immensely powerful. FormAPI provides all sorts of form manipulation such as hiding/showing, enabling/disabling fields making AJAX calls out to a server and even dynamically changing the validation regular expression of a field based on the values of other fields.

In case you aren’t ‘seeing the light’ just yet imagine the following scenarios:

I do understand that you can create custom data types for Umbraco but this constrains any client side script to within the data type and makes it difficult for form fields to interact with one another.

I’d like to post the complete FormAPI reference here, but it sits on a password protected customer support site which suggests to me that it isn’t in the public domain.

I know that I’d find something like this incredibly useful in Umbraco. Some may argue that it is over complicated and not really appropriate for a simple CMS. I’m fully aware that the one of the major plus points of Umbraco is simplicity for the end user. What do you think?

There are a couple more TeamSite features that I think would make good additions to Umbraco functionality which I’ll try to blog about when I have the chance.

Oh and yes, the post it titled '#1' as there are more features I'd like to see in Umbraco, but I'll wait to see if I get shouted down on this one first :)

Comments

Leave a comment