The goal of this adventure was to leverage the SharePoint blog site template and SharePoint Social Rating capabilities to construct an ideation type of site.
But alas, this was one of those things that took me an ungodly amount of time to try and figure out a solution for… hopefully this post will be able to help others solve the same problem. Yes, there are lots of blog posts out there that show how we can add the rating capabilities to individual blog post entries, but I couldn’t find one that described the process for adding the rating stars to the homepage of the blog site template’s summary view web part for each of the posts. With some help with the MSDN SharePoint Forums and a fellow by the name of Raghavendra Shanbhag, we figured it out with the steps outlined below.
1. Assuming that your blog site has been created, turn on ratings for your Posts Document Library as described here.
2. Download this custom blog.xsl file and upload it to a Style Library or any other Document Library of your choice. Note at around line 121 is where we added the AverageRating field to the output which is the only customization that was performed on the original XSL.
3. Open the blog site homepage and edit it in SharePoint Designer. Here, you’ll want to click on the Posts web part and add the Rating (0-5) column for the field to be displayed in the view.
4. While you’re in SharePoint Designer, you can also include a link to the custom XSL that you had uploaded in Step 2.
5. Now go ahead and save all the changes that you’ve made in SharePoint Designer and then head over to your blog site in the browser. You should now see the rating stars below the title of each of your posts but you’ll find that they are not clickable/interactive. What you’ll want to do here is to edit the homepage of that blog site and then add another instance of the Posts list to one of the web part zones. After you add it, change the view on that web part to the “All Posts” view which should contain the rating stars. By adding this web part, it registers the necessary javascripts and CSS for the rating stars to properly function. But we don’t want to have a duplicate set of posts on our homepage right? What we can do here is mark the 2nd Posts web part as hidden!
And with that, we have now transformed a SharePoint blog site into an ideation site 🙂
Henry, this is awesome. Would you mind posting a screen shot or two of what the end result looks like?
Hey Sherman, thanks for the suggestion. I just added a small screen shot of what the posting looks like with the rating stars to the end of the post.
i get an error like this :
once i save – after adding link to the custom xsl file.
This Web Part does not have a valid XSLT stylesheet:
Error: Reference to undeclared namespace prefix: ‘xsl’.
Approved
10
http://kor300949v83:1000/sites/jaz3kor/Documents/blog.xsl
‘
1
1
1
:
|
|
Barath
This Web Part does not have a valid XSLT stylesheet:
Error: Reference to undeclared namespace prefix: ‘xsl’.
Thanks for posting this, Henry. I walk through the star rating add to the individual posts in my forthcoming book (Implementing Real-World Solutions in SharePoint 2010, MS Press Feb2012), and am now going to point to this post for an additional solution.
You’re very welcome Christian. Can’t wait to see how your book turns out!
i get an error
Tried to implement your solution today. It works well on the default.aspx (blog overview), however I couldn’t get it to work on the detail view (Post.aspx?ID=3). The stars are displayed correctly, but there is no functionality to them. Means I can only rate items on the overview page, which is kinda half-baked. Any suggestion?
I too implemented the solution. the rating started appearing in the default page and but could not have the functionality of rating the post there instead i need to rate them at the library where all post are located.
i guess there is some javascript error which stopping that functionality.
lex, i didnt get the start rating in post.aspx page , did you made any extra changes to get it there?
I am also facing same error , Any Luck ?
Very good post..
i have tried this and this logic working only for 1 post, if there is any other post rating coming for first post is coming for second post too, Have you faced this ?
I can see the star rating in default.aspx but how do i see it in post.aspx page , where i see a single blog post?
i did the same for post.aspx page as well but it is not woking.
I learned a lot along the way of implimenting this solution, But the functionality is not working. It shows the results, but it is not interactive. Have you found a solution?
Brilliant idea to automatically register the scripts. Wish I’d thought of it! Great job.
The second Post webpart needs to be in a different webpart zone for this to work. Awesome article. Thank you very much Henry!!!
Great article! it worked for me, thanks a lot!!
One question though, if I click one of the categories, the rating doesn’t show there, and I don’t seem to be able to apply the same approach because the category pages are not static pages, also the Posts web part doesn’t allow me to edit the current view in order to add rating column.
Does anyone know how to achieve this? Thanks.
Good Article , I was able to enable rating feature with the help of this article. Though I am facing one problem with this. user with contribute permission on blog site getting intermittent error
“Unable to display this webpart, to troubleshoot the problem open this web page in a Microsoft SharePoint foundation-compatible html editor such as Microsoft SharePoint Designer. If the problem persists, contact your web server administrator “
Hi,
I have made it on Allposts.aspx, default.aspx, it is available in Sharepoint out of box for these pages, but I am not able to work it on individual pages like “post.aspx?id=2”, I can see the rating implemented there but not working you just see but can’t rate… any suggestion Ideas how to rectify this, i got an error kind “Web Part Error: An unexpected error has occurred. Correlation ID: 8d79319c-6293-c027-b5f0-086ab4c91ca5.”
Thanks
works like a charm….thank you so much for this wonderful blog.
Hi Henry, how do you customise this in SharePoint 2013? In the SharePoint Designer 2013 it does not have the Add/Remove column button, is there a way to modify the source in the default.aspx ?