1

I have SharePoint Online environment, I use custom page layout for a specific publishing SP site.

When i go to "Rating settings" for the default page library with in the site and i activate "Allow items in this list to be rated?" and select "Likes" in the field. I get the Like/Unlike just for Allitems.aspx page.

I want to embed the same functionality on every page that uses my custom page layout.

I found the web controls that does the Rating functionality,

<SharePointPortalControls:AverageRatingFieldControl FieldName="5a14d1ab-1513-48c7-97b3-657a5ba6c742" runat="server"/> 

This code adds Page Ratings on all pages that uses the custom page layout.

Page with Rating.

I want to add something similar to get "Like feature" instead of Page Rating.

Are there any web controls or custom code options available for SharePoint Online?

I tried this, http://npatro.com/using-like-and-rating-functionality-in-sharepoint-2013-pages/, but that din help.

Please suggest.

Thanks

2
  • Do you mean like Facebook likes ? Commented Apr 9, 2019 at 13:29
  • wp.sjkp.dk/… see this blog post, it will help. Commented Apr 11, 2019 at 7:43

3 Answers 3

0

You can use the below rest api to get the likes count as well as who all are liked your page.

/_api/web/lists("Pages library GUID")/items("itemID")/likedByInformation?$expand=likedby 

For this api you have to pass Pages library GUID and item ID. It is a get request.

0

I have used Waldek Mastykarz feature to do this. It works for SharePoint 2016 as well.

https://blog.mastykarz.nl/like-publishing-pages-sharepoint-2013/

Bismarck

2
  • The Blog says, its a WSP solution. It will not work on SharePoint Online Commented Apr 11, 2019 at 12:43
  • This din't work on SharePoint Online. Commented Apr 23, 2019 at 17:31
0

Following this article, https://gist.github.com/sjkp/5563092 and writing some validations, I was able to achieve what i was looking for.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.