Again, this is really bad I think . 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
Browse to All Files > Lists > Posts
Right click Post.aspx and click Edit File in Advanced Mode
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.
- </ZoneTemplate>
- </WebPartPages:WebPartZone>
- <div style="padding-bottom: 10px; vertical-align:middle">
- <div style="float:left;display: inline-block; margin-top: 2px; margin-right:10px">
- Rate this post
- </div>
- <SharePoint:AverageRatingFieldControl FieldName="5a14d1ab-1513-48c7-97b3-657a5ba6c742" ControlMode="Display" runat="server"/>
- </div>
- <WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="LeftFooter" Title="loc:LeftFooter" AllowPersonalization="false">
- <ZoneTemplate>
Save it, and one more thing to add,
Add this line at the top (maybe at the third line is a good position).
- <%@ Register
- Tagprefix="SharePoint"
- Namespace="Microsoft.SharePoint.Portal.WebControls"
- Assembly="Microsoft.SharePoint.Portal, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
Save it, and you’re done. And, here’s the result,
See, I told you, it’s easy.
UPDATE 28 Jun 2012:
I laughed at myself, found that my article is not complete , 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.
- You’re not paying for SharePoint . 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….
Good one.
BalasHapusSo I added it and it works on the left pane not under each post :-( any hints?
BalasHapusCheers Rob
The code must be in the right place. take a look carefuly at the line number at my post image. If you confuse where the code must be placed, you could switch to Split View Mode in SharePoint Designer.
BalasHapusHope it helps.
Awesome post...someone said this post is an old one and not sure whether it would work...but then old is gold aint it? :)
BalasHapusThanks for the help.
Thanks a lot, ARUN. I'm just trying to archive all the solutions in one blog whether I found it by myself or from some fellow blogger. Happy to help and thanks for stopping by...
Hapus:-D
Awsome and simple enough to follow. Thanks so much for sharing it..
BalasHapusyou're welcome... nice to know ya... ;)
HapusIt works great but it better if the rating show up at the http://.../blog/default.aspx page. Can that be possible?
BalasHapusAFAIK, you can't.
HapusUniquely, AFAIK, this control only works when there's a SPContext.ListItem on. It means that wherever it'll be, won't work as long as no SPContext.ListItem.
That's why when you provide the control's attribute, for SharePoint:AverageRatingFieldControl, no List Name and List Item provided, right? Just put it on the code, right?
So, it's not possible, unless, you create your own control for this rating, which is very time consuming.
Hope it helps.
Great trick ! thank you
BalasHapusu're welcome...
HapusNice! Much thanks.
BalasHapusOk- I am new to SHarepoint but I have followed the steps and I get unknown server tag SharePoint:AverageRatingFieldControl
BalasHapusDid you add the tag for Microsoft.SharePoint.Portal.WebControls? The control originating from that Namespace, from Microsoft.SharePoint.Portal.DLL, so you must add it.
HapusLines 1 and 2 and line 2 already contained the recommended code and i was unable to modify- I have included them below
Hapus<%@ Page language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:webpartpageexpansion="full" meta:progid="SharePoint.WebPartPage.Document" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
Have you saved it? Have you publish it (if there's a publishing feature turned on)? Worth to check whether you turned on publishing feature or not.
HapusHi! Any idea on why this might work in our QA environment and not in PROD? Are there any security or permissions settings we might look at?
BalasHapusIt's just a simple modification, no security settings. You might need to publish (if you've turned on publishing feature). Beyond that, no other settings.
HapusDo you know how to show total ratings field too? Can we just use the "RatingCountFieldControl" control similar as for average?
BalasHapushttp://msdn.microsoft.com/en-us/library/ee593603
I never tried that before. But worth to try.
HapusNevermind, I got it. This is the code I used.
BalasHapusCode didn't show. Basically it's same code just use SharePoint:RatingCountFieldControl and for FieldName use b1996002-9167-45e5-a4df-b2c41c6723c7
HapusSHarepoint 2010 Blog site on the Post.aspx page - I added the Averagerating column to the comments list view webpart using Sharpoint designer but the column does not show up- what is causing the column to be hidden. I can see it in the code as FielRef
BalasHapusWhat do you mean with "to the comments list view webpart"? If you mean by adding it inside list view webpart, of course it'll error somehow.
HapusWhat you can do is to add above the comments list view web part. ;)
Hope it helps....
I've been unable to figure out how to get this to work. In SharePoint Designer 2010, Lines 1-261 and lines 470 to end are highlighted in yellow, and do not allow editing.
BalasHapusI'm a farm admin, so it's not a permission issue.
any ideas?
You just need to swing your sword and click "Edit in Advanced Mode" :-P
HapusThat's a security feature that securing your SharePoint Designer from naughty fingers.
Great Job! Have this working, was fairly easy to do. As a an added note, I also created a view of top rated for all blog entries, then added as a webpart so all posts can be seen by order of rating. Just a simple add for the users.
BalasHapusCool, maaan........ nice effort!
HapusThanks so much! I tried so many methods, this one is the most clearly detailed and it worked for me!!
BalasHapus