I have recently been working on a number of public MOSS websites, all of which need to be accessible. Making websites accessible with MOSS poses a number of problems, but none of them are that big. I thought it maybe useful to post about how I approach it and how some of the problems can be overcome.
To develop your accessible SharePoint publishing site visit SPWorks to download ARF, a free development framework.
The first thing I would say about accessibility in MOSS is that it will be extremely difficult (if not impossible) to make a site accessible (to AA or AAA) if you are using the webpart framework. This means that WebParts are out...even the extremely useful ContentByQuery webpart. Publishing controls and standard ASP.Net controls are your friends and should be used in place of webparts.
The problem with webparts is the WebPartZone, which generates a table to host the webparts, and the webparts themselves which generally create a TABLE in which to live. These TABLEs can be difficult to remove and I am yet to see a solution which doesn't involve some slightly 'hacked' code.
So how do I approach it...
- Create a standard MOSS publishing site.
- Delete the 'Press Releases' sub site.
- Go to the site content types and create new content types for your site. I normally create a BasePage for the site, which inherits from the Page content type. This will become the base for all the other content types used on the site (this allows columns to be added to all pages in the site later in development). I then create HomePage and LandingPage content types, which inherit from the BasePage.
- I then create the layouts for both the HomePage and a default LandingPage.
- Once that is done you can create a new home page using your new layout. This should then replace the default 'Welcome Page' for the site.
- You will now be free to delete the 'default.aspx' created when the site was initially created. Also, I would normally rename the newly created home page to 'default.aspx'.
- I would then create a temporary subsite, which will be used to create a site template. In this subsite you create a new welcome page using the default LandingPage layout created in step 4, ensuring you set the 'Welcome Page' to use the Landing Page and delete the OOTB 'default.aspx'.
- At this point you can delete all the OOTB master pages and layouts. I normally remove them in order to shrink the contents of the 'masterpage' folder. Make sure you do not delete PageLayoutTemplate.aspx...SharePoint needs this.
- Once that is done you can create the new subsite template. Navigate to the 'Site Settings' of the subsite and replace 'settings.aspx' with 'savetmpl.aspx' in the address bar. This will allow you to save the site as a template. Give the template a meaningful title, ensure you include content and save it.
- Now you can delete the temporary subsite.
- Go to the 'Site Settings' for the site and select 'Page Layouts and site templates'. Here you can remove the default 'Publishing Sub Site' template and select the one you just created. This will ensure that all new subsites are only using the content types & layouts you have created.
- You can now create your new master page for the site. You can get a minimal master page from Microsoft. Which gives you a good start.
At this point I would recommend getting and using the Floating Console from Artemis. This removes the burden of positioning the SiteActionMenu, PublishingConsole, etc within your page design and best of all it's free!
- At this point it is best if you have the HTML from the design company or whoever is producing the accessible HTML for the site. Take the HTML source you have and paste everything within the BODY tag of the design into the FORM tag in your master page. Add the CSS and images to the appropriate folders within the site and fix any IMG tags with the HTML you pasted. Then add the CssRegistration entries to your HEAD section, removing any ones added by SharePoint. Don't forget to change the DOCTYPE at the top of the master page if you are using XHTML.
- You should now be able to navigate to the home page of you MOSS site and it should appear exactly as the same as the page from the design agency. If it doesn't check you CSS and images...there maybe image references in the CSS which you have not changed.
And that is kind of that. You now have a MOSS publishing site which looks exactly like the design. Your job is to work through the different sections of the page replacing them with placeholders (which allow the layouts to generate thier own HTML), publishing field controls (controls which update columns/fields of the page) or normal ASP.Net controls which just generate HTML.
Your goal here is to gradually add controls or placeholders to the page which re-produce the accessible HTML they replace exactly...which is why webparts are out!
I normally start with the navigation (being able to navigate the site is good)...this generally involves creating a new control which inherits from System.Web.UI.WebControls.Menu. This serves as a direct replacement for the default SharePoint menu control and will use the same datasource. This retains the ability to modify the navigation via AreaNavigationSettings.aspx.
Another option for menus (Navigation) are the CSS Friendly Adpaters, which can produce the same results...personally I prefer XSL, but they both work well.
If you read my blog, you are probably aware that I like to use XSLT to produce the HTML... my menu controls always produce XML and use an XSL stylesheet stored in the 'XSL Style Sheets' folder (or similar) to produce the HTML. This makes re-producing the HTML from the design very easy and it makes changes, due to the inevitable design changes throughout the development, easy.
Identifying the 'content area' is normally next which allows the PlaceHolderMain for all the layouts to be defined. After that editable content is probably easiest to replace with a standard HTML publishing field controls.
SharePoint has a lot of field controls OOTB which can directly replace the HTML content, but you will probably need to write some of your own. My post about publishing controls has some sample controls.
One of the first I normally create is a SPSiteDataQuery control which, using some of the methods I have mentioned previously , generates XML and uses XSL to produce the HTML. Most websites list postings (News, FAQs, Recently Updated, etc) and so creating a flexible base class can really help...this will be your replacement for the ContentByQuery webpart.
You now gradually work your way through all the layouts required for the website, replacing the HTML in the design with a control which re-produces exactly the same HTML...only dynamically.
There are other issues but this should give you a good start...I intend to follow up this post with further recommendations and sample code which will should give you a 'leg up' towards producing an accessible SharePoint website...watch this space!
UPDATE: An article decribing a sample control is now available
If you would like to use the same concept to develop your accessible SharePoint publishing site visit SPWorks to download ARF, a free development framework.