In this post I will show you how to change some of the look and feel settings of your site. I spend some time looking for the right property until I discovered that there is something which is called the publishing web. Some of the settings are only available through the publishing web. Of course, that is the case when you have activated the publishing (infrastructure) features. Let me show you the differences.

First of all I have a created a basic team site. When I go to the Site Settings I will see the following under look and feel:


You can, for instance, enable the quick launch or tree view controls through the Tree view link. The Top link bar is rather dissapointing. You can add new links to the top bar and that’s it. Much more sophisticated navigation (including the inheritance and the siblings stuff) can be activated by the Publishing Infrastructure feature. Go to Site Settings, Site Collection features and activate it:


Now, have a look at the Site Settings again and watch the differences:

See that the Top link has dissappeared? Instead you will see the master page settings and the navigation link. Right. The navigation options are great! You can activate a top or left bar that shows you all of the subsites and or pages, inherit the parents global navigation, shows the current navigation (like document libs and so on), subsites but also sites on the same level (siblings). Finally you can even add new links, headings, or hide specific items:

When I was trying to look for a way to programmatically set all navigation options for all webs in a site collections to the same settings, I discovered that the navigation options as shown above are accessible not through the SPWeb but through the PublishingWeb. Of course you might think! But hey, do not forget to reference the publishing dll else your IntelliSense won’t make a difference. 😉

Here is a code example:


SPWeb currentWeb = web.Site.OpenWeb(web.ID);
            currentWeb.QuickLaunchEnabled = checkBoxEnableQuickLaunch.Checked;
            currentWeb.TreeViewEnabled = checkBoxEnableTreeView.Checked;
            currentWeb.Navigation.UseShared = checkboxGlobalNavigationSameAsParent.Checked;
            PublishingWeb pw = PublishingWeb.GetPublishingWeb(currentWeb);
            if (pw != null)
                pw.NavigationShowSiblings = true;