Blog - Robert Bogue [MVP]
Rob's Notebook
SharePoint Calendar
Thor Projects LLC - Welcome
Sunday, December 21, 2008

The SharePoint Calendar - SharePoint Events and Releases

Several of the folks I know, including Joel and the SharePoint Product Team started posting "calendars" as text in a blog post. That was entertaining because I was just getting ready to do the same thing to talk about the conferences I'd be at and the presentations I'd be giving. However, I realized that we've got the same problem with calendars as we have with most content, it's scattered all over the internet. So I created a SharePoint Calendar that has all of the major events that I could find. I've added an email alias calendar@thorprojects.com that you can send requests for calendar updates to. (My assistant will process these for now, if we get enough activity I'll automate the system.)

Once we get a few people linking to their entries in the calendar I'll put a web part on the page that will provide a set of links to pages linking to the event (so you can see who's presenting what at the event)

With a little luck we'll end up with one calendar for SharePoint stuff.


Categories: Professional | 1 Comment
 
Monday, December 08, 2008

Video Screen Cast Samples Available

Last week I mentioned that Office Online posted a few of The SharePoint Shepherd's Guide for End Users tasks. Well, I've decided to make the screen casts for these tasks available too. Here's the list, use the (screen cast) link to get to the screencasts.

I hope you enjoy the screen casts!


Categories: Professional | 0 Comments
 
Thursday, December 04, 2008

The SharePoint Shepherd On Office Online

I just was catching up and realized that earlier this week Laura announced that the first three tasks from The SharePoint Shepherd's Guide for End Users appeared on Office Online. Earlier this year I agreed to let Microsoft publish a few tasks from the book on Office Online. The first three tasks are:

Go check them out!


Categories: Professional | 1 Comment
 
Wednesday, December 03, 2008

Adding a Second Global Navigation to Pages in SharePoint

Recently I had a client that was interested in having two different global navigations. The first global navigation across the top -- using the default global navigation that SharePoint implements. However, they wanted a second global navigation in the left column on top of the normal Quick Launch menu. As it turns out this isn't that hard, if you're willing to create a site to host the second global navigation. Sahil Malik posted a blog entry titled "Implementing Consistent Navigation across Site Collections" that showed some promise, however, he was using an XmlSiteMap provider and a custom .sitemap file -- I needed to allow my customer to perform the modifications to the global navigation themselves.

The answer I came up with was to create a site off of the root, which I called global navigation (/globalnav). I hid this from the real global navigation (so it didn't show up in the top bar) and managed the navigation in the site so it had the navigation items I needed at the top of my Quick Launch bar. However, the question was how to plug it in.

The left navigation, or Quick Launch, is emitted out of a placeholder in the master page. The default.master file contains the PlaceHolderLeftNavBar which already contains some default content. In that default content is a delegate control called QuickLaunchDataSource. (You can learn more about Delegate controls in my article "SharePoint's Delegate Control Power"). The default contents of the delegate control is a SiteMapDataSource control:

This is referring to the SPNavigationProvider in the web.config file. There's a node in /configuration/system.web/siteMap/providers/ which is the site map provider -- As shown below:

<add name="SPNavigationProvider" type="Microsoft.SharePoint.Navigation.SPNavigationProvider, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />

You may notice that the SiteMapDataSource is referencing a StartingNodeUrl of "sid:1025". This is important for two reasons, first, StartingNodeUrl is useful for navigating to the node in the SiteMapProvider that you want to start at and second because 1025 is the ID for local navigation (quicklaunch) in SharePoint. (By the way, global navigation has an ID of 1002).

This data source is consumed by the SharePoint AspMenu which appears immediately below the delegate control:

The SharePoint AspMenu is a thin shell over the Menu control in ASP.NET. It has the same format for attributes -- including the DataSourceId which matches the id of the SiteMapDataSource above. So following the chain... The SharePoint navigation provider returns a set of nodes, the SiteMapDataSource starts at the 1025 (quick launch/local navigation) node and returns the child objects. The SharePoint AspMenu displays the items that are returned (based on the attributes provided.)

With this knowledge we can create a secondary SiteMapDataSource for our global navigation and use the StartingNodeUrl to override where we start at. However, we need one more piece of information. One of the other entries in the web.config file is:

<add name="GlobalNavSiteMapProvider" description="CMS provider for Global navigation" type="Microsoft.SharePoint.Publishing.Navigation.PortalSiteMapProvider, Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" NavigationType="Global" EncodeOutput="true" />

This site map provider is useful because because it expects to receive a URL in its StartNodeUrl attribute from the SiteMapDataSource. Thus we can create a SiteMapDataSource like this:

Wait a moment you say, what happened to Asp:SiteMapDataSource, well, I wanted to get a few more attributes (described in a moment) so I changed to the actual type of the SiteMapDataSource (PublishingNavigation:PortalSiteMapDataSource). This is a subclass of Asp:SiteMapDataSource so it can be used wherever SiteMapDataSource is expected. Of course, I need to register the PublishingNavigation prefix at the top of the file if it's not already registered, like this:

<%@ Register TagPrefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

So other than the additional attributes, I changed to the CurrentNavSiteMapProvider from SPNavigation Provider, StartingNodeUrl to "/GlobalNav" from "sid:1025", and changed the ID to "GlobalLeftNav" from "QuickLaunchSiteMap". This effectively gives me a navigation provider that would be local to /GlobalNav (my global navigation site).

Then all I have to do is copy the <SharePoint:AspMenu> that currently is used for QuickLaunch and replace the DataSourceId with my new GlobalLeftNav Id from my PublishingNavigation:PortalSiteMapDataSource. In the end I have a working second global navigation.

I promised to explain the additional attributes in the PortalSiteMapDataSource. Well, by default the navigation will include sub-sites and pages in the site in question. Rather than relying on the users to remember to hide them if they created any, I can tell the navigation provider that I don't want any subsites or pages returned. The effect of which is that I get only the headings and links that they added manually to the navigation of the site.

In the end I chose to implement the changes I describe here in a page layout so that the users could easily choose to include the navigation -- or not, based on the page they were creating.


Categories: Professional | 0 Comments
 
Monday, December 01, 2008

Dumping the RAW CQWP Query Results (or How To Change the ContentQueryMain.xsl)

Sometimes working with SharePoint feels like picking a lock. You know that if you get the right combination the lock will open and you'll be able to get what you want -- however, figuring out that critical combination is difficult. I've spent too many hours trying to do something simple -- I wanted to look at the results of the query generated by the CQWP in its raw form. There are several posts that talk about how to dump out the attributes/fields that are coming back from the query, including Heather Solomon's. This uses a simple technique in the ItemStyle.xsl which creates a template that iterates through each of the attributes by using a select of @* (meaning Attributes, All). However, I just wanted to see the raw XML. The XSLT to do that is pretty trivial...

However, there aren't a ton of examples on how to even customize the main XSL for the Content Query Web part. The property you need to change in the web part file is MainXslLink. However, this property isn't covered in either How to: Customize the Content Query Web Part by using Custom Properties or How to: Customize XSL for the Content Query Web Part. I located the property and tried to customize it with my little dumpall.xsl that I keep around (it is little more than the XSL snippet above). However, every time I'd use it I'd get an error message:

Well, it turns out that there are some dependencies in the CQWP to what's in the main XSLT file. (No I didn't isolate them.) So instead of starting with a blank file to dump out everything I made a copy of the ContentQueryMain.xsl where I replaced the following snippet:

with the snippet above to dump everything out. This worked beautifully. It dumped out what the CQWP was providing to the XSLT for transformation.


Categories: Professional | 0 Comments