hit counter script
Skip to main content

Go Search
SharePoint for End Users
  

 Other Blogs

  EndUserSharePoint.com by Mark Miller
  Microsoft SharePoint Team Blog
  Michael Gannotti on SharePoint+
  SharePoint Design by Heather Solomon
  Asif's Blog by Asif Rehmani
  Ian’s SharePoint Blog by Ian Morrish
  SharePoint Demystified
  Siolon - Chris Poteet
  SharePoint Guru - Rod Stagg
SharePoint for End Users > Posts > Use SharePoint and Silverlight to display a summary of SharePoint blog posts on any site page
Use SharePoint and Silverlight to display a summary of SharePoint blog posts on any site page

by Rod Stagg, SharePoint Solutions Architect/Developer
http://www.rstagg.com | Allyis Inc., Kirkland, Wa

Overview:

We have been investigating ways on our intranet at Allyis to surface information via a more automatic and less manual process through various features and also to implement multiple ways for discovering data/information across the site.  One area in particular we have been looking for improvement has been to increase the discoverability of our leadership blogs and encourage employees throughout our organization to blog as as way to increase collaboration and information sharing. 

As a way to address these efforts we recently developed and deployed a suite of web-parts (one of which we call the BlogRollUp web-part) which displays details on the most recent post made to any of our SharePoint blogs.  The web-part can be added to any site page, configured to point to a specific blog, and uploaded into the web-part gallery for others to use as well. 

Single Post Version
Multi-Post Version

Features:

  • Displays blog title as a hyperlink to the original full post.
  • Displays the first 215 characters of the post body as an excerpt.
  • Displays an image for the blogger or blog.
  • Displays the post's category as a hyperlink to view all similiar posts.
  • Displays the number of comments as a hyperlink to the comments page.
  • Displays an alert icon hyperlinked to the blog's alert page.
  • Highlights background on mouseover.
  • Users can configure the web-part settings. 
  • Can be deployed across site collections. 

Technical Approach:

  • The user-interface was designed and developed entirely using Microsoft Expression Blend, Silverlight, and Visual Studio 2008. 
  • Custom SharePoint web-part to host the Silverlight application which allow users to configure which blog, blogger image, and alerts link from the web-part properties pane directly. 
  • The Silverlight application code uses the initParams provided from the webpart or HTML test page and the URL protocol to access the blog's post list directly.
  • The web-part can be configured once and easily exported from and imported to the webpart gallery and added to any site page on any site collection.   
  • The Silverlight application was deployed into a SharePoint document library for ease of future updates. 

Advantages of using Silverlight over a DataView Web-Part for instance include more portability, more rich user experience, and able to migrate to new sites/hardware easily.

  • Can be added to any site page on any site collection easily by the user without a developer or SharePoint Designer involved.
  • Can be easily deployed on our customer’s SharePoint sites and do not require a substantial effort to migrate to new hardware.
  • A more rich UI is possible using Silverlight and development is simplified using Visual Studio and C#.
  • The project files (.xap) developed in Silverlight are stored in standard SharePoint libraries and can be updated without the need for IT to be involved.

Deployment Methods:

Deployment using only a document library and a content editor web-part without the need to install server-side code and as such administrative access typically not required.

  1. Download the Visual Studio solution .zip and extract the files.
  2. Download BlogRollUp.zip
  3. Create a folder named ClientBin in a SharePoint document library to store the Silverlight application. 
  4. Locate the BlogRollUp_Web\ClientBin\BlogRollUp.xap file and copy into your new ClientBin folder
  5. Locate the BlogRollUpTestPage.html, update the initParams to use the settings for your particular blog including siteurl, imagepath, listid, and alerturl. 
  6. Copy the updated BlogRollUpTestPage.html file to the root of your new document library.
  7. On a site page add a content editor web-part and reference the BlogRollUpTestPage.html file inside an iframe. 
  8. Export the now pre-configured web-part to your desktop and upload back into the webpart gallery with an appropriate name identifying the BlogRollUp webpart so other users can add to their site pages without having to configure themselves. 

Deployment using the custom web-part where server-side code is installed via the .wsp solution file for the webpart and typically requiring administrative access

  1. Download the Visual Studio solution .zip and extract the files.
  2. Download BlogRollUp.zip
  3. Create a folder named ClientBin in a SharePoint document library to store the Silverlight application. 
  4. Locate the BlogRollUp_Web\ClientBin\BlogRollUp.xap file and copy into your new ClientBin folder.
  5. Download the .wsp solution file
  6. DownLoad BlogRollUpWP.wsp
  7. Install the provided .wsp solution file via stsadm -addsolution
  8. Activate the solution from SharePoint Central Administration or stsadm -activatefeature
  9. Upload the provided webpart .dwp file into your web-part gallery via site setting, web parts. 
  10. Add the web-part to a site page, update the Silverlight web-part settings section with the appropriate .XAP fullpath, siteurl, imagepath, listid, and alerturl for your particular blog
  11. Export the now pre-configured web-part to your desktop and upload back into the webpart gallery with an appropriate name identifying the blogrollup webpart so other users can add to thier site pages without having to configure themselves. 

Summary:

This is just one way of displaying some pertinent details on recent posts from the blogs dispersed throughout the intranet while also making it easy for users to add to any site page.  Using Silverlight allows .NET developers to develop rich UI in Expression and Visual Studio and store the .xap files in SharePoint document libraries for future updates. 

Comments

Love it, but ...

This is a really nice solution. But when i saw the title I thought it did something a little more. For months now I've been looking for a solution that would do this, essentially, for multiple blogs or even all blogs across a collections or multiple collections. it would create a directory of all blogs, highlighting the newest post, showing their My Site photo, etc.
at 6/23/2009 11:06 AM

RE: Love it, but

Hey, well since you ask we have another Silverlight web-part and modules for SharePoint that does exactly what you describe except it pulls in all posts and comments across the entire site.  We call it our Recent Intranet Activities feature and supporting web-parts.  Also pulls in both added/update site pages, wiki pages, documents, discussions, virtually everything across our entire intranet.  You would have to talk with my boss before I could just drop all the source though:)  Contact me directly at rstagg@allyis.com for more info if you are interested.
at 6/23/2009 4:09 PM

Curious as to why you used Silverlight to do this.

Thank you. Really looks well built/put together and it's great to see more sharing and free components. However I am curious as to why you decided to go with Silverlight here? This requires users to download the silverlight component (like flash) makes it harder for users to copy paste, interact with, and many organizations to support (as silverlight development is still not as well known as say HTML or XSL). This is a few reasons of why I personally might have avoided it in this case and I am interested in hearing your take on it. What were the advantageous reasons you chose silverlight in this situation over say the content query webpart, a custom webpart, rss rollup or something like this?
at 6/24/2009 6:02 AM

RE Curious

Hey Curious:)  Thanks for the comment.  Yes, we thought about this.  The deployment is running on SharePoint 2007 in an intranet environment where Silverlight has already been deployed and installation of the Silverlight plugin is supported.  If we were deploying on the internet we may consider having both a Silverlight and non-Silverlight version maybe just like if we were deploying in Flash. 
 
For our intranet we evaluated using Silverlight vs a custom SharePoint web-part, customizing the dataview web-part XSL, or even using the URL protocol and writing our own XSL, and the CQWP as you mention. 
 
Some advantages of Silverlight:
  • Silverlight provides a richer set of tools to develop rich user experience than the built-in dataview web-part or content query web-part can provide.  
  • We can simply develop and deploy a rich user-interface much faster in Silverlight and the code is more easily updated and maintained than custom javascript or XSL. 
  • In some cases our Silverlight applications can be designed and deployed completely in Microsoft Expression by our designers without the need for any development. 
  • Silverlight allows our .NET developers to develop and work in an environment and language they are familiar C# and Visual Studio with and deploy Silverlight applications as part of thier existing SharePoint web-part development environments. 
Advantages over customized dataview web-parts and content query web-parts for instance:
 
DVWPs have hard-coded listids, site paths, and require a multitude of changes by someone familiar with SharePoint Designer and XSL to make them portable-i.e. typically we see dataview web-parts customized in SharePoint Designer that only work if deployed at the same site level at the list and typically only work on the particular list they are developed on. 
 
Also dataview web-parts are frequently customized and deployed on list forms that result in the list form being unghosted resulting in performance degradation. 
 
Using Silverlight we can host inside a SharePoint web-part and allow the user to easily drop on any site page and set the listid, sitepath, and other settings directly from the web-part pane themselves without having to use SharePoint Designer to customize the DVWP properties. 
 
Deployment advantages over just a custom web-part with custom developed UI:
 
Silverlight applications can be deployed to a document library without the need for IT to refresh the web-part installation.  Since the Silverlight application can be referenced from the web-part this allows us to make on-going changes to the Silverlight application and have them automatically deployed throughout the site - very useful.
 
Would be happy to chat more with you offline on the subject,  contact me directly at rstagg@allyis.com if you like.
 
Thanks again for the thoughtful comment.
at 6/24/2009 11:44 AM

Re: Use SharePoint and Silverlight to display a summary of SharePoint blog posts on any site page

Interesting article .. but am I missing something here followed both deployment methods on the first one I just get a blank screen and on the second one I get a webpart erro: Cannot import WebPart1 Web Part.. Cheers M
at 7/3/2009 7:40 AM

Re: Use SharePoint and Silverlight to display a summary of SharePoint blog posts on any site page

Interesting article .. but am I missing something here followed both deployment methods on the first one I just get a blank screen and on the second one I get a webpart erro: Cannot import WebPart1 Web Part.. Cheers M
at 7/3/2009 7:46 AM

Re: Use SharePoint and Silverlight to display a summary of SharePoint blog posts on any site page

One question: Has your SharePoint environment already been configured for Silverlight support?  If not that could explain the issue you are having particularly with the blank screen for the test page. 
 
I have another Silverlight Web Part I developed as a generic wrapper for Silverlight projects that is an easy install and would be a great way to verify your environment and/or any missing steps in my deployment steps.  There is a supplement link in this post to the steps required to enable Silverlight support in SharePoint.  In any case you can try the generic Silverlight webpart as a test and let me know...Silverlight Generic Web Part 
 
I will run through the deployment steps once again but as long as you are able to install the .wsp the web-part should be installed and it's just a matter of referencing the web-part dll from the .dwp file. 
at 7/7/2009 4:17 PM

RE: Having challenges with deployment

Deployment Method 1 (no server-side code required to host Silverlight application in a document library and display in iframe) 

For deployment method 1 if as you describe you see a blank screen when loading the test page and no errors then it's likely you don't have the MIME types added to your web server to support Silverlight specifically for .XAML and .XAP.  You can easily add this via IIS Manager see Tim Sneath's blog for a easy step-by-step for enabling Silverlight applications on any web server
 
If however you are seeing errors then I would check the initParams settings in the test page and verify the siteurl and listid are correct. 
 
Deployment Method 2 (server-side code required to host Silverlight in a SharePoint web-part)

If you are seeing a webpart error as you describe in Deployment method 2 it's likely your SharePoint installation has not been configured to host Silverlight based web-parts.  In this case check out Karine Bosch's post on configuring SharePoint to host Silverlight web-parts and verify all the steps. 
at 7/8/2009 10:52 AM

RE: Deployment

Important: Make sure to turn on the required fields in the SharePoint blog's post list default view including: body, id, both category fields, both title fields.  The values in these fields are used to the display the data in the blog rollup webpart. 
 
Thanks, Rod!
at 7/12/2009 10:01 PM

Alert Param

The instructions tell us to set the alerturl in the initParams. I don't see this this the BlogRolluptestpage.html file. What am i doing wrong?
at 7/22/2009 12:19 PM

RE Alert Param

Apparently I left the alerturl out of the test page-my bad.  All that is necessary is to append your initParams string to include the alerturl using a single comma as the separator and leaving out any quotes ie:
 
siteurl=http://mysite, listid=mylistid, alerturl=http//myblogsalertpage
 
 
at 7/27/2009 9:33 PM

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Name (required) *


Body *

URL

Type the Web address: (Click here to test)  

Type the description: 

Contact

The control is not available because you do not have the correct permissions.
Attachments