Browse by Tags

All Tags » Web Content Management (RSS)

Which Doctype to use with SharePoint 2007?

Designing and developing accessible web sites on top of SharePoint 2007 gets more and more attention in the community. But the more developers try to reach the required accessibility or standards compliancy level, the more challenges they face and the more questions pop up. One of such questions is which doctype should be used for standards compliant and accessible web sites. As for SharePoint 2007 the answer is simple: XHTML - it is the only possibility. SharePoint 2007 is built upon ASP.NET 2.0: it makes use of the ASP.NET 2.0 runtime and enriches it with extra functionality. ASP.NET 2.0 has been designed to render XHTML output. Although the compliancy level can be set in web.config not all controls adjust their output to this configuration. Furthermore the runtime itself uses hidden fields for State Management: all these fields contains the ID attribute which begins with __ (double underscore). Unfortunately such names are allowed only in XHTML so there is no chance for fallback to HTML 4.01 unless you want to rewrite the ASP.NET 2.0 runtime. The choice for XHTML as the only possible doctype for ASP.NET 2.0 and SharePoint 2007 applications is quite odd knowing it's the only doctype so far officially not supported by Microsoft browsers. According to the specification all XHTML pages should be served with the application/xhtml+xml mime-type. This allows the parser (no matter whether it is a User Agent or another information system) to process the file as if it was an XML...

SharePoint 2007 redirect solved: using 301 instead of 302 redirects

Each time you request a Site Collection ( http://domain/ ) or a Site ( http://domain/foo/ ) of your Publishing Site you get redirected to the .aspx">.aspx">.aspx">.aspx">http://domain/Pages/<WelcomePage>.aspx . SharePoint 2007 uses the 302 header (location temporarily moved) for this purpose. Surprisingly even WSS uses the 302 header to redirect a root url to the default.aspx. In comparison ASP.NET uses an internal redirect to render the default page when the root url requested: there is no redirect in this situation. The whole issue about the 302 headers is that the redirected locations don't get crawled by search spiders which don't follow temporarily moved pages. While it's not really an issue for intranet environments it has major impact on indexing the content of Internet-facing web sites and making them searchable using a search engine. Looking for an answer I have researched the SharePoint runtime: SPHttpHandler, SPRequestModule and PublishingHttpModule classes. As none of these has given me a clear answer I have noticed that there are multiple references to the Redirect method present in the code which uses the 302 header as well. To solve the issue I have designed a custom redirect HttpModule which uses 301 headers instead. The requirements The module must rewrite all request for a Site Collection or Site. Url's of these request might but don't have to contain trailing slash (/). Furthermore the module must distinct...

The impact of developing an accessible web site in SharePoint 2007

The development process of a typical Web Content Management solution based on Microsoft Office SharePoint Server 2007 consists of three main areas: User Experience, Functionality and Deployment. The development process begins mostly with designing the total User Experience. Based on the business requirements the designers determine the particular areas on the web site and the corresponding functionality. The typical products of this stage are the User Interface (UI) design and the Interaction design – the way the UI responds to the user input. The next stage is translating the User Interface into code: HTML, Cascade Style Sheets (CSS) and JavaScript (if any client-side interaction required). As the products of this cycle form the baseline for the solution to be delivered it is crucial to name all the requirements of the total product and in particular the accessibility aspects. During the last stage of the User Experience phase the translated User Interface is being incorporated into SharePoint 2007. At this moment the Master Pages and Page Layouts are being formed and the content areas and the Web Part Zones are being determined and placed within the Page Layouts. In many cases the User Interface incorporated in SharePoint 2007 is being hand over to the developers who are going to fill it with the dynamic controls they are going to build. Using the original User Experience translations the developers start their work. First of all basing on the original User Experience...

Automatically marking up abbreviations and acronyms in SharePoint 2007

Accessibility is a broad term and reaches way beyond the standards compliant code only. Accessibility is in my belief a set of features improving the understanding of information presented by an information system. I have to admit though compliant and semantic HTML is a very important factor of accessibility as it hosts the information. As I have recently solved the issue of standards compliant HTML in SharePoint 2007 I have started looking for new challenges and accessibility improving solutions. Almost immediately I have stumbled upon automatically marking up abbreviations in content. I have faced exactly the same challenge during the Rock My Website competition last year when John, Martijn and myself were building an accessible web site in ASP.NET. I wanted to implement a solution which would automatically markup all known abbreviations in de content using some kind of dictionary. As we weren't using any Content Management System we would need to think of another way to maintain the abbreviations dictionary. Eventually we have dropped the idea then, but now we have SharePoint 2007. Looking at standard SharePoint 2007 features I have almost immediately came up with a solution for this challenge. The requirements First of all to Provide a user friendly way to maintain the abbreviations dictionary. Storing it in a central location will decrease the amount of work required to maintain the dictionary and keep the definitions consistent. Then markup all the abbreviations found...

Creating Site Variations and Variations Label Menu not working

MSDN has a great article on how to create site variations. The article walks you through creation of Variation Labels and then viewing the site with the Variations Label Menu. To enable the site variations label follow these instructions as Microsoft Read More......( read more ) Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

Automatically generating a hierarchical Title in <title> element

Recently while working on an Internet facing web site for one of our customers I thought of creating a control which would automatically create a hierarchical Title in the <title> element, like: Site Collection - Current Site - Current Page. Standard SharePoint 2007 allows you to define the title on the Master Page and within a Page Layout. Default SharePoint 2007 displays the Page Title in the <title> element. As I've been recently researching the accessibility issues I have noticed that such a behavior can cause loosing the context - especially if the visitor is vision impaired. Secondly it might cause search engines indexing a page and not linking it to the organization (Site Collection) or for example a division within it (Site). You could solve it using the standard features like displaying the Site's Title using <SharePoint:ProjectProperty> but still it wouldn't provide me the flexibility I wanted it to have. That's why I have decided to make a control which would automatically generate a title based on the existing hierarchy. The requirements The most important is generating a title consisting of information from the three levels: Site Collection, Site and Page the user is currently on. As you might want to hide the Site Collection title in some cases it should be also optional whether it should be displayed or not. In my example I have used a minus as a separator: however it should be possible to set the separator without rewriting the...

W3C Validator for SharePoint 2007

SharePoint 2007 is a very extensible development platform. Thanks to its flexibility the developers keep coming with new features which extend the user experience. One of the areas where the things are still missing is the Web Content Management: accessibility in particular leaves plenty of challenges to be tackled and features to be added by the accessibility enthusiasts and developers. One of these is the W3C Validator for SharePoint 2007. As I've mentioned some time ago we are busy here at Imtech ICT Business Solutions designing, developing and testing our own accessibility toolkit for SharePoint 2007. As the whole solution works perfectly I have started looking for some other ideas on how to extend it and enrich the editors' experience. One of the ideas I've got was incorporating the W3C Validator support into SharePoint 2007. First of all the requirements. As it's supposed to be editors' tool it needs to reside on the Publishing Console. It's supposed to validate the page: preferably before it's published so an editor can correct his mistakes if any found. Then the report: embedded into SharePoint 2007 or just a redirect? As embedding might enhance the total experience it would require you to provide new versions of the SOAP response parser (as the response you get from the W3C Validator is in the SOAP 1.2 format). Because most of the people dealing with accessibility and standards compliancy are familiar with the generated output that's the...

Extending the SharePoint:FieldValue WebControl

How many times did you try to incorporate some extra rules or formatting into Page Layouts? Formatting a date is just one of the many examples solving which can cause you spent many hours trying to using the out-of-the-box available controls. The SharePoint:FieldValue is probably the most commonly used control, especially in Page Layouts where you don't want to use the Edit-in-place experience. Yet this control doesn't have any customization or formatting possibilities. That's why some time ago me and my colleagues at Imtech ICT Business Solutions have thought about creating our version of this control with some more formatting properties. As soon as we have created it, we have started benefiting from it: because we had the code of it, extending it with extra functionality is just a piece of cake. Anyway, let me introduce you the Imtech:PageProperty control. I would like to guide you through a process of creating a simple yet powerful custom WebControl. At the end of this post you should be able to use the example we will build here and extend it with new functionality to make it fit to your needs. I assume you know the basics of working with WebControls within SharePoint 2007. Furthermore I assume already have a project, which builds into an assembly. I also assume that it's content is available within SharePoint. If you are a beginner in SharePoint and have questions about these steps, please react in the comment so others will be able to learn from it too. We...

Imtech Test Content Generator v1.3.0.0 (free SharePoint 2007 tool)

Testing the editors area in SharePoint 2007 isn't really convenient. Image you would like to check whether the overview Web Part you have made really shows 100 items per page. Copying the items in the Explorer View might be a solution, still it's that handy when it comes to testing various Content Types and Page Layouts. Another scenario you might want to test is scheduling: does my page become available at the given timestamp? Yes, you can test this using the SharePoint 2007 interface, but still I think it can be done much easier. When it comes to testing custom Web Parts, overviews and the rest of the editing features within SharePoint 2007 I have developed Imtech Test Content Generator v1.3.0.0: a tool which helps me creating a given number of pages. As parameters I can set the desired Page Layout and content within the page. One click on a button, a cup of coffee and a couple hundred of items are there for me: Checked In, Published or even Approved if I want to. Imtech Test Content Generator v1.3.0.0 is free and you can use it without any restrictions. Download Imtech Test Content Generator v1.3.0.0 from our CodePlex site . Posted on SharePoint Blogs Del.icio.us | Digg It | Technorati | Blinklist | Furl | reddit | DotNetKicks

Webrichtlijnen (WCAG 1.0 Priority 2+) Accessibility in SharePoint 2007

Last Thursday I gave a presentation about accessibility in SharePoint 2007: the existing challenges and my approach to it. I have been invited by the Dutch Information Worker User Group to share my experience with other Dutch developers. Standing on the other side on such an event was my first time. I have to admit I did find it quite exciting and didn't really know what to expect of it - being a developer it's not really your daily job to speak for a group of over 40 people. For those of you who didn't have the chance to attend my presentation let me give you a brief overview of the contents. Developing SharePoint 2007 solutions is quite different as soon as you take accessibility into consideration - especially if it's as highly leveled as the guidelines in the Netherlands. It's very important that you understand the way the whole platform works before you begin designing and developing an accessible solution. SharePoint 2007 and ASP.NET 2.0 both don't support it out of the box. It is possible though but quite challenging. Understanding the plumbing of both platforms will make your life way easier. Choosing for an accessible Internet facing site built upon SharePoint 2007 has major impact on the design and development phases. You have to start with designing an accessible User Interface which will eventually make big part of the delivered User Experience. Then the difficult part comes: translating the drawings and sketches into HTML, CSS and JavaScript...

First 100% Webrichtlijnen (WCAG 1.0 Priority 2+) compliant SharePoint site - almost there

As I have recently mentioned, here at Imtech ICT Business Solutions we are busy with first 100% Webrichtlijnen compliant Internet facing web site based on SharePoint 2007. Earlier this week we have finished the development en begun testing the solution. Yes, we have discovered a few undocumented features which we have immediately resolved. Anyway testing for compliancy with the Dutch government's guidelines was a serious part of this project and it was my job to achieve this goal. As I have mentioned earlier I have developed a toolkit which helps gaining enough control over the generated page output just to make it compliant and yet still working. Furthermore I have taken a look at the response of each request and decided to clean this one as well. As a result I have taken the response size from 788kB down to 303kB! That's more than 50% per request on the home page only! During the development we did have to consider the compliancy. For a moment it looked like we would be getting problems with custom controls' events linked through in-line JavaScript. Using our client side script library we have succeeded to preserve the same link using unobtrusive JavaScript though. The last one were the Web Parts. I have to admit: I have hoped AKS would help me on this one. A bunch of good guys working on a serious compliancy solution for SharePoint and they have admitted there would come over 20 Control Adapters shipped with AKS. When I got the AKS release in my hands and installed...

PlaceHolderPageTitle is the root of all evil

Recently we have been experiencing some serious problems while working on our newest project. As we needed a customized version of the Publishing Portal template we have made a new version adjusted to our needs. What we needed to do is to reference the customized Master Page and create a default Welcome Page using one of our Page Layouts. And then it's started. First of all we got some really strange error messages like 'Page contains illegal characters', etc. After stripping the whole Site Definition and having looked at every comma out there I have found something strange was going on with our Page Layouts. At the bottom of each one of them I've found: < html xmlns : mso ="urn:schemas-microsoft-com:office:office" xmlns : msdt ="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882">< head > < META name ="WebPartPageExpansion" content ="full"> <!--[if gte mso 9]><xml> <mso:CustomDocumentProperties> <mso:PublishingPreviewImage msdt:dt="string"></mso:PublishingPreviewImage> <mso:ContentType msdt:dt="string">Page Layout</mso:ContentType> <mso:MasterPageDescription msdt:dt="string"></mso:MasterPageDescription> <mso:PublishingAssociatedVariations msdt:dt="string"> </mso:PublishingAssociatedVariations> <mso:PublishingHidden msdt:dt="string">0</mso:PublishingHidden> <mso:PublishingAssociatedContentType...

ASP.NET events can cause troubles

...if you are developing a Webrichtlijnen compliant website in ASP.NET or let's say in... SharePoint 2007! Recently a new version of the Webrichtlijnen on-line quick scan tool has been released. Not that long ago I have reported that my concept on making SharePoint 2007 sites 100% Webrichtlijnen compliant did work . As soon as I have checked the same code using the newer version of the quick scan tool I have found there were still some errors present in the website. These errors are JavaScript events related and these are attached to the ASP.NET controls. Let me explain it to you by using an ASP.NET button as an example. So let's say you're making a custom search Web Part: a text field to enter the search query and a button to run the search. Using the ASP.NET events concept you create a new OnClick event for the button and you attach it to your button. What ASP.NET does is it creates a JavaScript onclick event and attaches it to the output. What you see in the source code of the rendered page is something like <input type="button" onclick=".... Why is this a problem? Conform the Webrichtlijnen you are supposed to be using non-obtrusive JavaScript. Any in-line events are therefore forbidden. An onclick attached to a button or any other control is a no-go. But does it mean you cannot use these events at all? Well, it depends. If you're building a quite simple Web Part like the one above you could use one of the Web Part's methods triggered...

Another Internet facing website based on SharePoint 2007

...Coming soon - really soon. Last week we have started realising a new project for one of our customers: an Internet facing website based on SharePoint's 2007 WCM. It would've been 'just another' plain SharePoint 2007 WCM solution, but since we love new challenges here at Imtech ICT Business Solutions we have decided to use our last concept : developing Webrichtlijnen compliant SharePoint 2007 sites. Since the project has just started we have the possibility to take this extra requirement in consideration in all the custom features we're going to deliver and just get sure it's all Webrichtlijnen compliant. As far as I know there are no Webrichtlijnen compliant SharePoint 2007 based websites out there. It's extra challenging then to be the first one to prove it is actually possible. As there are many people waiting on the official release of the AKS who do care about accessible and compliant websites, it seems to me a really nice show case for our lightweight compliancy kit. John (also member of the development team on this project) and I will post our experiences on regular basis so check out our blog once in a while if you are interested in accessibility in SharePoint and the things we have stumbled upon during the project. And if you're more interested in the toolkit itself: I've been recently invited to give a presentation about accessibility challenges in SharePoint 2007 at Dutch Information Worker User Group on November the 29th. It is...

CSS causes JavaScript error while moving Web Parts in edit mode

While working on an Internet facing Web Content Management SharePoint 2007 solution for one of our customers Erik has stumbled upon an interesting by-design feature in SharePoint 2007. At some point he has noticed that he couldn’t move Web Parts anymore: clicking on any of the title bars would result in a JavaScript error. When I’ve heard about this behaviour I almost immediately thought about the custom JavaScript code delivered by the interactive designer. Removing all of this from the Master Page has unfortunately proven that the custom JavaScript worked just fine and had nothing to do with the issue. By debugging the error message I have found out that the error is being caused by a JavaScript function belonging to SharePoint: MSOLayout_GetRealOffset . Running through page’s elements using DOM made me think about the custom Web Controls we have made. I have suspected overriding one of the render methods improperly causing the error. Still after stripping the Master Page from all the custom controls didn’t help. The last remaining piece of customization left were the various CSS files delivered by the designer. Run of ideas I removed it as well and... voillá – the bug was gone and the Web Parts could have been moved again! After some research I have discovered that the error has been caused by the position property used with anything else than static. The error occurs while processing parent elements of the selected Web Part. The exception is being caused by uncaught attempt...
Posted by SharePoint Blogs
More Posts Next page »