Jun 9, 2011

Add OOTB Rating Control in SharePoint 2010 Blog Site

Again, this is really bad I think Confused smile. Rating Control doesn’t exist in Blog template site in SharePoint 2010, even if you have activated Rating feature in Posts list. I think there’s a good solution out there in internet, but I have a different one. It’s not the best solution I think, but can be comparable. The easy way, but good enough.

Open SharePoint Designer 2010 and open your SharePoint 2010 Blog Site
image

Browse to All Files > Lists > Posts
image

image

Right click Post.aspx and click Edit File in Advanced Mode
image

Put that code (look at the footer of this post) between 2 XSLTListViewWebPart of Posts and Comments, maybe at line 221 like in the picture.
image

image

Code Snippet
  1. </ZoneTemplate>
  2. </WebPartPages:WebPartZone>
  3. <div style="padding-bottom: 10px; vertical-align:middle">
  4.     <div style="float:left;display: inline-block; margin-top: 2px; margin-right:10px">
  5.         Rate this post
  6.     </div>
  7.     <SharePoint:AverageRatingFieldControl FieldName="5a14d1ab-1513-48c7-97b3-657a5ba6c742" ControlMode="Display" runat="server"/>
  8. </div>
  9. <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="LeftFooter" Title="loc:LeftFooter" AllowPersonalization="false">
  10. <ZoneTemplate>

Save it, and one more thing to add,
image


Add this line at the top (maybe at the third line is a good position).

Code Snippet
  1. <%@ Register
  2.     Tagprefix="SharePoint"
  3.     Namespace="Microsoft.SharePoint.Portal.WebControls"
  4.     Assembly="Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

Save it, and you’re done. And, here’s the result,

image


See, I told you, it’s easy.

UPDATE 28 Jun 2012:
I laughed at myself, found that my article is not complete Laugh, not really easy to follow for everyone. Thanks for Anonymous (as always) though, you “told” me without saying anything that my article is not complete. Though I still confused, some people still can follow my article and said “thanks, great article”. Aaah… they maybe a SharePoint expert.

OK, here’s what happen when people are not able to add rating control, that’s because of these reasons below. Configure / do these actions is a MUST, no bargaining at all.Stress

  • You’re not paying for SharePoint Smile. Just kidding… but really serious, means that you’re using the free version of SharePoint called SharePoint Foundation 2010, which is not included Rating capabilities.
  • Configure your SharePoint User Profile Service Application.
  • Associate your SharePoint User Profile Service Application to Web Application where your MySite is hosted. Usually this done by default if you’re not planning to use custom settings, but worth to check.
  • It depends on a site collection feature, named SharePoint Server Publishing Infrastructure. Activate this by navigate to the top level site from your blog, by clicking Site Actions and then Site Settings, and find Go to top level site settings to navigate to the top level site (your MySite). Find Manage site collection features, and activate SharePoint Server Publishing Infrastructure feature.
  • It depends on a site feature named SharePoint Server Publishing. My suggest is to activate the site feature only on your Blog site. You can do this by navigate to your Blog site first, then clicking Site Actions and then Site Settings, and find Manage site features. Activate the SharePoint Server Publishing feature.
  • Enable Rating Settings on Posts list in your Blog site.

I got this from an article, reminds me of my mistake.

Again, hope it helps…. Sorry