This is just wierd. I had to change the navigation options for a meeting workspace using code on a MOSS farm. The meeting workspaces were all under a publishing site, with the publishing feature turned on, so the option to inherit the navigation from the parent site is available in the UI.
However, there is no option to set it in the API.
When dealing with publishing sites, you can easily set it by using the PublishingWeb object instead of the SPWeb object - but using PublishingWeb.IsPublishingWeb on the event workspace returns false.
So I had a look at the code that runs when you click OK on the navigation settings page - and guess what? Microsoft doesnt check if the site is a publishing web or not - they just assume it is, and set the properties! So I did the same, and the code runs great. It doesnt matter that it is not a publishing web.
Code:
PublishingWeb pubWeb = PublishingWeb.GetPublishingWeb(web);
pubWeb.InheritGlobalNavigation = true;
Sharepoint Tips And Tricks is Ishai Sagi's sharepoint information blog. It specializes in Microsoft SharePoint technologies, including web parts, development, configuration, customization, and best practices for the use of Microsoft SharePoint Server and Windows SharePoint Services. It also provides some related Office Information, including VSTO and VSTA and other office application development tips.
Sunday, July 12, 2009
Setting the navigation options for a meeting workspace
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment