Monday, January 12, 2009

CQWP and RSS Feeds

I decided to do a SharePoint blog, so here goes!

At my current client, we have a well defined Content Type structure. On the home page of their intranet they have CQWP's that roll up announcements, alerts etc from all over the site.

They needed a way for users to subscribe to the alerts. Since they were rolling up the content, having the users go to each list and subscribe to alerts was not going to work.

Since we were using CQWP's I decided to enable the RSS feed functionality of the CQWP. In the presentation section of the web part I checked the "Enable feed for this web part" and gave it a name.




I saved the web part and now a new shiny RSS icon appeared at the bottom of the web part:




Easy enough right? Not so fast.



I clicked on the RSS feed icon and got an ugly SharePoint error.


"Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). at System.Guid..ctor(String g) at Microsoft.SharePoint.Publishing.Internal.CodeBehind.FeedPage.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) "


I did some research into this and I saw a few people with the error, but no one with any cut and dry solution. I continued to try a few things and came across the solution (for me at least)



In my current implementation, we have the publishing Infrastructure Site collection features turned on, but not the Office SharePoint Server Publishing features at the site level. Therefore my CQWP was on the default page (http://server/default.aspx). By adding a pages library called "Pages", adding a page to it and dropping my CQWP onto that page, the RSS feed works!



Turns out the CQWP is assuming it's situated on a web part page in a "Pages" page library.


So as a workaround, created a small Content Editor web part that sits below the CQWP on the default page, and linked to the RSS feed page of the identical CQWP that resides on the Web Part page that is in the pages library...





Works like a charm!


Enjoy!!
Hopefully there will be many more to come!









1 comment: