Back
CMS in a world of web standards: Much simpler
Other·Calvin Correli·Jan 14, 2005· 2 minutes
I’m in the process of building a content management system for a large non-profit organization, where one of the strict requirements os that all output from the system must be XHTML Strict, and, in general, strictly standards-compliant. And it struck me that a CMS in the world of web standards is an entirely different beast from what it was just a few years back.

Before web standards, the need for a CMS was largely driven by the fact that you needed truckloads of very complex and fragile, typically table-based, markup to achieve the desired effect.

But with web standards, the markup, the XHTML, that you produce is very simple. It’s simply a matter of mapping your content objects into XHTML. Basically, for each attribute of each object, you:

  • Pick the tag you wrap it in: A, P, UL/LI, ADDRESS, etc.
  • Choose the structure: What’s inside what, in what order does it appear.
  • Have the abiliy to attach a CSS class/ID to it.
Your stylesheets take care of the rest! There are a few minor details, like attributes on tags, and of being able, for example, to put a dummy SPAN tag inside an A tag, as a hook for image replacement, etc., but those are minor details.

It would seem that using an object-oriented language (which we’re not for this project) would map beautifully onto this problem: Just have a “to_xhtml” method on each of the objects that can represent content, and let it recursively render itself.

There’s still the back-end user interface, which is a lot of work, but at least the core rendering engine of the system could be very straight-forward. It’s not impossible that I’ll be doing something along these lines in Ruby on Rails in a few months, if others aren’t already doing it by then :)