Friday 13 March 2009

View a SharePoint Blog Through a Web Part

When you create a blog in SharePoint it is created as a subsite (here's how). I had a request from a client to display the blog posts in a web part on the main site. After thinking about it for a bit I thought I'd just use the RSS Viewer web part to display the RSS feed from the blog. Unfortunately this resulted in the following message:-

"The RSS webpart does not support authenticated feeds"

After a bit of googling around it appears that this solution is not viable because we are using NTLM authentication. This prompted me to assess the alternative - moving to Kerberos authentication. On the face of it this seemed like a great idea. Posts were saying about how much faster Kerberos is and how much more secure it is along with how it was going to fix my issue. Then I looked at how to implement it, it's not a quick change. I also remember working with a SharePoint MVP a year or so ago who seemed very wary about moving from NTLM to Kerberos and the unintended side effects that may occur. So, I'll have a chat to our infrastructure team about moving to Kerberos at some later point in time, but it seems a bit overkill for this issue.

I had a bit of a think about the problem and my mind started thinking about creating a custom web part. I think, coming from an ASP.net development background, I'm always too hasty to look for the 'custom code' approach to these type of SharePoint issues. I said to myself that I'd try to find an out of the box way around this. That's when I remembered the Content Query Web Part.

The content query web part allows you to pull data from lists from sites within a site collection. It sounded like a perfect solution to my issue. People are always telling me how great it is (which makes me think I'm not using it anywhere near enough) so I gave it a try. I used the guidance provided by George in an ECM Team blog post. It wasn't a two click solution but it wasn't rocket science...

1. Create the web part and change the location to pull data from the posts list in the blog subsite.

2. Change the .webpart file to pull in the Body field.

3. Modify the ItemStyle.xsl in the style library to display the fields as required.Nice and simple but very effective. :-)

Let me know if you'd have thought about or tackled this differently.

Start of random mumblings...

Hi All,

Welcome to my first blog, so excuse me if I'm a bit rusty! Let me introduce myself. My name is Russell Giddings and I am a .Net Developer with a passion for SharePoint in particular. I have 7 years commercial experience of development although I've been playing around with code for over 20 years.

Anyway, enough about me, on to the blog. Firstly, I don't believe I am all knowing and all seeing. So this is definitely not going to be a preaching blog! I feel that given the pace of technology evolution there is always huge scope for learning and improvment. What I aim to gain from this blog is other peoples views and critiques on my processes and solutions. It's part of my journey to becoming a top class developer which may help others who are in a similar position. So get commenting and tell me what you really feel!!!

Maybe one day I'll be as capable as you! ;-)