Yesterday, I spent a full day talking about the Web Content Management features delivered with MOSS 2007 here for the Tam Tam guys (and girl). One of the issues they are facing is with government policies requiring them to have no table elements in the design of their Web pages. Question of course was, what is happening with SharePoint next version and very specifically in Internet-facing sites. There was some disappointment when looking at the HTML-sources generated by SharePoint. All of the navigation controls dump their stuff as a set of TABLE elements. Not good!

So, the question came of course how to change this behaviour and how to tweak SharePoint to let the navigation controls generate DIV and nested UL tags. A big ‘Duh?’ from me to be honest at the start. I have trained a lot of people on SharePoint but I can’t remember this issue coming up in any of my classes. Anyway, after a G-search and a small discussion with the students I found out that their question was not so uncommon as it first seemed. It looks like speech engines have problems with the TABLE and prefer DIVs when reading out a page for blind people and there are also problems with crawling engines not behaving at their maximum with TABLE-style layouts. So the ‘Duh?’ ended up in ‘Jeez..this looks an interesting challenge’.

Now the solution is luckily provided by ASP.NET 2.0. First of all, the AspMenu navigation controls used by SharePoint (and for that matter by ASP.NET 2.0 itself) cannot be tweaked to spit out DIVs and nested ULs instead of TABLE tags. It looks like it is kind of hard-wired in the controls.

There is however the possibility to make use of the Control Adapter framework in ASP.NET 2.0. The general idea here is that the output of the rendering of a control is intercepted by the adapter and then transformed in basically anything you want before it is flushed to the client. It is an interesting approach and useful for a lot of scenarios. And good news is that the ASP.NET guys have provided us with a clean adapter framework to get us quickly up-and-running.

There is an out-of-the-box Menu Adapter that we were able to activate for the SharePoint pages and yes, all of the AspMenu navigation controls didn’t spit out TABLE tags. Unfortunately, the result were not DIVs and nested ULs but SPANs. Bummer!

After looking a little further, we found a couple of other interesting resources on the Web that could help us (also thanks to our ASP.NET girl @ U2U). The most interesting one is the CSS friendly ASP.NET 2.0 control adapters beta 1.1 tool you can download. It has good documentation and some samples to work with. Take for example a look at this page to see what you can do with the adapters. Scott Guthrie has also a good posting on it. Exactly what we were looking for and after some work, one of the ‘brightest’ students in the class got it working for a SharePoint internet site. No more TABLEs, only DIVs and nested ULs. I leave it up to the TAM TAM guys to decide whether they want to make the procedures public :)

Interesting day yesterday. Let’s see what today brings!