This is the archive site for the pioneering blog CamWorld.com, which is no longer maintained.
Cameron Barrett's personal site can now be found at cameron.barrett.org and his professional site can be found at cameronbarrett.com.

August 28, 2003

CSS Catch-22

I have found myself in the inevitable position of coding a web site that I know will need to be maintained by someone who does not have the same level of skills as me. I badly want to code the site using CSS layout but I fear that as soon as I hand over that code someone is going to open it up in Dreamweaver or Homesite (or Front Page!) and I will start getting phone calls.

One solution is to comment the code in a professional manner, documenting what each DIV container is doing and in the stylesheet what each class does. However the kinds of people who use the tools I listed above aren't the kinds of people who read HTML source code. I know that soon after I've handed over the code I will look at the site and I will find FONT tags wrapped around the DIVs, tables stuck inside the DIVs indenting a paragraph, and all kinds of other tag-soup.

My choices are:

  • Code it in tag-soup with tables and spacer GIFs for layout
  • Hand over the code along with a rudimentary CMS so that the site editor (and their tools) never actually touch the layout code
  • Hand over clean code and then spend far too much time editing a web site that I shouldn't have to deal with

It makes me wonder if anyone has written some Javascript (or DWMX API code?) that I can put into the HTML that can interact with Dreamweaver and warn the user not to add tag-soup code. I haven't used Dreamweaver in years but I've heard some things about it's flexible XML-based Extensions that make me think something like this might be possible.

I realize that Dreamweaver does support the visual layout of CSS-driven designs, but it's nowhere near the level it needs to be for a editor to treat it as a WYSIWYG tool. All of the sites I've coded using CSS layout display pretty bad inside of Dreamweaver; bad enough that a site editor trying to make changes to the site is going to think something is broken and then try to fix it -- using tables for layout, of course.

One analogy I've used to explain this problem is: A mechanic with thousands of dollars worth of tools doesn't necessarily mean that he's a good mechanic. You've got to know how to use those tools so as to not break anything. The same goes for WYSIWYG tools like Dreamweaver.

What to do? Tag soup or CSS?

Posted by Cameron Barrett at August 28, 2003 08:22 PM
Comments

Hey Cam,

What I do is use DreamWeaver MX, which has excellent CSS/XHTML support to create sites like this from the get-go. It's actually not difficult to write your CSS and setup your files so that they open up nicely in MX.

Depending on who actually will be maintaining the thing, I use DreamWeaver Templates to allow the editors to only edit content areas of the pages which I specify. DreamWeaver templates can actually do a lot of advanced junk too, repeating areas, "library" items, templates within templates, etc.

If they want to dish a little cash, you can add Macromedia Contribute to the mix to make things even simpler and more controlled.

Unfortunately, you won't always be able to stop someone from really mucking up pages without a CMS that controls each and every field of data. But that is another nasty bag of worms. :-)


Posted by: BenJ at August 28, 2003 08:52 PM

Just as a followup -- Macromedia's new version of Dreamweaver is coming out very soon (in a couple weeks, I believe). It is supposed to increase its CSS support tremendously over MX (which in my mind is already pretty good).

I don't know if this will mean anything to your situation, but I thought I'd point it out.


Posted by: Aaron Christy at August 28, 2003 09:20 PM

Yeah, I gotta say that the only two options you have are to plug in a CMS like MT to manage it, or to stick with the Dreamweaver/Contribute combo.


Posted by: Anil at August 28, 2003 09:31 PM

I'm drifting toward Contribute. The potential problem with Movable Type is that if the site contains primarily static content your going to need a slew of index templates or a bunch of weblogs. Someone has to administer them and one template error and there goes the whole deal.

With Contribute the templates will be essentially uneditable, they can only do so much damage.


Posted by: Al at August 28, 2003 10:04 PM

Have you ever heard of City Desk? It is a great solution to this common problem. http://www.fogcreek.com/CityDesk/index.html


Posted by: Gary at August 28, 2003 10:08 PM

Contribute is definately an option, but my own favourite CMS is moveabletype, however all of this type of system wont stop users entering Ampersands and Quote signs which will invalidate the code. Neither of them include a profanity checker either!

So if your after total purity then you're probably going to have to roll your own.


Posted by: jim at August 29, 2003 03:32 AM

Why not ask the maintainer what tool they would like to use and build the site using it? If the maintainer does not know then pick a tool that they can use, has training, and has good telephone support and add the cost of these to the contract.


Posted by: Andrew Gilmartin at August 29, 2003 09:02 AM

One of the problems is that the site I'm designing and coding is volunteer work, so I'm not getting paid. This prevents me from falling back on a maintenance contract, charging for the extra time I spend, or spending a bunch of money on a CMS that can handle the clean separation of content from structure.

I believe the client wants to use MovableType to manage the site but that probably won't prevent the site editor from messing up the templates.

MovableType is a great CMS and I can do an amazing amount of things with it but it's not quite as robust as it needs to be for this project -- though I still think it will end up getting used.

The person building the back-end for the site is exploring other open-source CMS options, including Typo3, Drupal, and some others.


Posted by: camworld at August 29, 2003 10:28 AM

Sounds to me like you should be looking at Contribute. I've checked it out myself for a potential client (whose business we didn't end up getting). Contribute is pretty much limited to editing static information pages, but if that's all you need...


Posted by: Tomas at August 29, 2003 12:13 PM

Lock down.

If you want them to use Dreamweaver/Contribute to edit the site, lock down the parts you don't want them to mess with. Use includes/server-side-scripting for navigation and other redundant parts so they aren't as easy for a novice to accidentally change. Create your stylesheet so that they can use basic paragraph/heading and bold/italic functions in Dreamweaver/Contribute to make changes without messing things up. Forbid the use of the Font pulldown -- they'll probably use it anyway, but you can at least try.

A simple CMS or even MT would have benefits; this would mostly come down to if you want to spend more development time to avoid maintenance time or not. A tough choice on non-paid gigs.


Posted by: Paul at August 29, 2003 03:12 PM

A style guide can go a long way towards educating them. In fact documenting both the IA and the design would probably at least slow the inevitable entropy once the site is out of your hands.

IA Style Guide

The Style Guide Zeldman did for Charlotte Gray

NYPL's guide

It doesn't have to be that extensive. Even a brief guide is better than nothing.


Posted by: Tanya Rabourn at August 29, 2003 04:16 PM

What I was going to say was very similar to what Paul said: lock down, but, with a hybrid concept: code it up however you want (by hand, perhaps) then open the files in DW and plug in the "editable areas" and let them edit those with Contribute. I've done this with DW, but it was in the time before Contribute.

Next, issue a warning to them that the CSS is complex and shouldn't be fooled with. Oh, and back up, so when they wreck it anyhow, instead of just "told you not to..." you can say "now don't wreck this 2nd one, or no mo' pro-bono."


Posted by: ~bc at August 29, 2003 08:31 PM


>as soon as I hand over that code
>someone is going to open it up in
>Dreamweaver or Homesite (or Front
>Page!) and I will start getting
>phone calls.

(snip)
>However the kinds of people who use
>the tools I listed above aren't the
>kinds of people who read HTML source
>code.

Huh? I hand code HTML and XHTML for hours at a time using HomeSite 5 and validate everything I can... my non-validating pages are usually due to deliberate hacks or code from other developers that I have no control over. I feel like a cat with a hairball in my throat, seeing HomeSite and FrontPage in the same sentence {hack, spit} unless the sentence reads "HomeSite is good, FrontPage isn't..." Sorry to post off-topic, but I couldn't let that one pass unremarked.


Posted by: Jorah at September 4, 2003 06:38 PM

Jorah, you're correct and I need to clarify. I'm well aware of the fact that tools like Dreamweaver and HomeSite are capable of editing (and producing) clean and valid HTML and CSS code. My statement was more general - as in, generally *most* of the people who use these tools don't know how to use them properly and can too easily add non-valid code that does not belong and will interfere with the layout/structural code.


Posted by: Cam at September 5, 2003 10:29 AM

Okay, Cam, I'll stop sulking. :-)


Posted by: Jorah at September 5, 2003 12:58 PM