Paul Howson’s Website tdgq.com.au

Design and Publishing Notebook

Limitations of Templates and Content Holders

One of the puzzling things about Business Catalyst is why tried and tested software designs successfully used in open source content management systems (and hence readily available to mimic) have been completely ignored.

This approach has led to a lot of pain for Business Catalyst developers.

Take the example of templates. Anyone who has built other than trivial websites will know that templates often have common elements. There is an overall page design with specific customisations for different sections of a website.

Following the programmer’s axiom of DRY — “Don’t Repeat Yourself” — it makes sense to factor out these common elements.

Because websites usually have a hierarchical structure, templates which nest inside other templates (or “subtemplates”) are a common solution which meets this need for DRY. Many CMSs offer nested templates.

But not Business Catalyst. Why not? I’ve yet to hear a good reason from Business Catalyst.

Is there a work around? Well, Business Catalyst offers “Content Holders” as a way to factor out repeated content. Can we use Content Holders to factor out repeated parts of a template? For example, could we use one Content Holder for first part of the template before the page content and another for the second part? Different templates could then just include these Content Holders and we could write most of the template code just once.

Alas, if we try this we find that Content Holders can only be created and edited via the WYSIWYG editor and this silly device thinks it knows better than you what you want. It closes any unbalanced html tags. Hence splitting a template between two Content Holders doesn’t work. Sigh…

(Note: This limitation has since been removed. As of 2011 you can edit content holders via the FTP interface using your favourite code editor which, of course, does not automatically balance tags.)

Oh well, maybe we can still factor out common code providing it is self contained and doesn’t contain unbalanced tags? Let’s try taking repeated material that should go the <head> section of each template (e.g. css and javascript includes) and putting that in a Content Holder.

This solution works if we use the FTP interface to templates. But if we subsequently try to edit that template using the WYSIWYG editor, this ridiculous contraption, which is too smart for its own good, silently moves our included content out of the <head> and into the <body> of the template. Imagine the possibilities for disaster caused by an innocent attempt at editing the template!

I wonder if any of the Business Catalyst engineers have ever built a website using Business Catalyst? It seems very doubtful. Because if they had, they would have come across these problems and fixed them. There are obvious solutions which would not be difficult to implement. Technical difficulty cannot be a plausible explanation for why these things are not fixed. It has to come down to lack of awareness of these design deficiencies — a lack of awareness which comes from a lack of practical experience using the tool.