SharePoint 2007 and web standards

Posted on 2007-11-22 22:05:45

Since the start of this week, I’ve been tasked with writing up some HTML and CSS standards for our SharePoint team at work. As resident self-proclaimed “CSS guru”, I had already helped them to solve a few CSS problems they were having in the past few months. Most of those CSS problems were caused by SharePoint itself: it generates awfully bad HTML, and some default style rules. Furthermore, if a page is in “edit mode”, there are all kind of buttons and a floating toolbar added to each text field and text area, making a pixel-perfect design fall apart because boxes are suddenly 50 pixels wider than they are normally.

Anyway, so I’m in charge of writing up some standards. I’ve done that before both at HeavenGames and at my previous job. However, these standards will be specifically for SharePoint, so I finally got my hands dirty and acquired a VMWare image with Sharepoint on it from one of the Sharepoint guys, to see how bad it really is.

One of the boys helped me install one of the sites they made on it, and set up a “default” site as well, so I could see how Sharepoint thinks things should be.

When loading a site for the first time, one gets a mysterious error which says “try again later”. Hitting F5 instantly will properly load up the site. On top of that, everything is mighty slow when running it in a virtual machine: Sharepoint only runs on Windows Server 2003, and our workstations all run WinXP so development has to be done in VMWare images.

One look at View -> Source on the default site was more than my poor eyes could handle. A handful of atrocities:

  • HTML 4.01 transitional doctype. This wouldn’t be so bad (it was a full doctype including URL), if not for the next point:
  • Parts of the page in XHTML (self-closing tags: />), part of the page in HTML.
  • Invalid HTML too: a <span> with a <span> inside (okay), with a <table> inside. A what? A table, which brings us to the next point:
  • Tables used for layout. Come on, this is 2007 we’re talking about, not 1997.
  • A default stylesheet which contained at least 10 errors at first glance: the font-size was set in 10 different places, and always with a space between the amount and the unit, which is plain wrong. Internet Explorer understands it, the rest of the world doesn’t.
  • HTML generated by the visual editor looks like this:
    <p><span><span><span><span><span class=ms-rteCustom-ArticleTitle>Some
       text</span></span></span></span></span></p>
    

I could go on, but I closed the source viewer at that point, dismayed by what I saw. So this is how Microsoft expects us to develop websites, even though they’ve switched their own sites to (more or less) table-less layouts? Granted, it’s possible to do that in Sharepoint as well, but the site menus and management options will still be done with tables, inline CSS, and a buttload of Javascript which does not even run on alternative browsers such as Opera. They tout support for Firefox 1.5+, but editing text in a “rich textbox” still doesn’t work.

No wonder people have been having a lot of problems with it.

And I’m supposed to write some guidelines and standards for this mess? Ugh. The project leader for this moaned today: “do you think anyone at Microsoft uses Sharepoint at all?” My answer: definitely not.

Posted in: Web standards, Work