SharePoint 2010: How to change rating icons
English: Sometimes you may received a request to change rating icons, from a normal star to a love icon. So, how would you do it? Figure 1. Original rating icons
Figure 2. Modified love rating icons 1. Find and prepare rating icons. In this case I will need to prepare 4 styles rating icons
Title
Sample
Size
a. Empty Rating
16x16
b. Selected Rating
16x16
c. Rating Overlay
448x16
d. Rating Overlay RightToLeft
448x16
2. Save the new icons under 14 hive\Images. 3. Create script to modify SPWeb property bag. To ease our job, I will use PowerShell script as follows,
[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”) > $null $spSite = new-object Microsoft.SharePoint.SPSite(”http://win2k8"); $spWeb = $spSite.OpenWeb(); $spWeb.Properties[“Ratings_NewRatingIconUrl”] = “/_layouts/Images/love_RatingsNew.png”; $spWeb.Properties[“Ratings_EmptyIconUrl”] = “/_layouts/Images/love_RatingsEmpty.png”; $spWeb.Properties[“Ratings_ImageStripUrl”] = “/_layouts/Images/love_Ratings.png”; $spWeb.Properties[“Ratings_ImageStripRtlUrl”] = “/_layouts/Images/love_Ratingsrtl.png”; $spWeb.Properties.Update(); $spWeb.Dispose(); $spSite.Dispose(); iisreset
4. Voila ! And you can refresh your browser to see the changes. 5. Finally you can distribute your solution into a solutions package with feature activation events to register/un-register custom rating images.