0

CMS in a world of web standards: Much simpler

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 :)

2 comments

I didn't mean to imply that you would manage every single tag. But say you have a content type of "News story", which has a number of attributes, say: Title, subtitle, teaser, image, body, related stories, related links, related videos, etc. Eeach of those attributes basically map to either a DIV or a P or a UL, and with proper class and id attributes and a stylesheet, you're done with the rendering. Makes sense?
Read more
Read less
  Cancel
Right, that would be just one form of presentation, you could have multiple mappings to XHTML, different view on the same content (title, teaser, and full modes are terms we operate with in my current project), as well as RSS or other representations. So it should not be the only way. But the trick with CSS is that with the same XHTML representation of your content, you can style your way out of most of it, instead of bothering with the styling in HTML.
Read more
Read less
  Cancel

Leave a comment