It has been a while since I have posted a SharePoint specific blog post, it doesn’t mean that I haven’t been working with SharePoint, just that I have been stuck on SP2010 projects with little interesting to talk about. But now I’m also starting to work with SP2013 and hopefully over the summer I will be able to look into the SP2013 certifications too, so expect more SharePoint focused blog posts in the coming months.
In SharePoint 2013 the rating functionality that can be enabled on all libraries, have been extended with a simple like/unlike functionality in addition to the 5 star rating from SP2010. Obviously this is something the customers love, as it reminds them of their well-known facebook like functionality. Unfortunately Microsoft for some reason decided to only enable the functionality directly from the page library list view, where most end users will never end up when working with publishing sites.
To use the script the following requirements must be met
- like functionality is enabled on the page library
- You must include reputation.js if you are wrapping this in a webcontrol, that can e.g. be done with: ScriptLink.RegisterScriptAfterUI(this.Page, “reputation.js”, false);
All that is left for you to do is to insert the following html on your page, where you want the number of likes to appear.
I uploaded a full example on how to add the like functionality to the ArtileLeft.aspx page layout, it can be done with SharePoint designer if you are after a no code solution.