Tuesday, October 20, 2009

SharePoint 2010 Web Parts and WiKi pages

Wiki web parts - are new and do not have web part zones. You can add the web part in the text. This will allow us to give an option for the end users to create a page without an underlying page layout.

This works with hidden zones - which is where the web parts are actually stored but the location of the web part is marked in the wiki content using place holders. During rendering the webpart contents are moved to the in line location after rendering. Maurice just showed what happens if you retract a solution that had the web part that was added to a wiki page. The page was then refreshed - and no crash - the web part just disappeared from the page. however, when you go to the maintnance page (add a "?contents=1" to the page url) you can see there is an "error web part" on the page. It still doesnt tell you what that web part used to be - which is something I expected Microsoft to improve from 2007.

Also, Maurice showed a bug that is with the current version and he is not sure if it is going to be fixed - when you delete an error web part, the div with the web part ID remains in the content of the wiki page - not visible, but it is making the page heavier, and messier.

To add a web part to wiki pages using code, you add the web part as usual (using the web part manager) and then you change the text for the wiki to include a div that links to the GUID of the web part.

No comments: