How to introduce Like and Unlike option on SharePoint server 2019 on-premises News Post Page?

Mohamed Riyaz M 41 Reputation points
2024-05-29T08:01:37+00:00

I have created a Modern Communication Site Collection, Created several News Posts. I need to introduce a Like/Unlike function for every News Post page. My site visitors should be able to Like/Unlike. There must be a means to capture all Likes as well. How could I do that? I am NOT interested in activating Publishing Feature as it is not supported by Microsoft on Modern Sites. Thank you

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,593 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Yanli Jiang - MSFT 23,186 Reputation points Microsoft Vendor
    2024-05-30T08:32:07.7733333+00:00

    Hi @Mohamed Riyaz M ,

    Welcome to Q&A forum!

    To introduce a Like and Unlike option on a SharePoint Server 2019 on-premises News Post Page, you can use the Social Feed feature in SharePoint. However, this feature is not available in Modern Communication Sites. You mentioned that you are interested in activating the Publishing Feature, but it is not supported by Microsoft on Modern Sites. Therefore, you can consider creating a Classic Publishing Site Collection instead, which supports the Publishing Feature and Social Feed.

    To enable Social Feed, you need to activate the "SharePoint Server Standard Site Collection features" and "SharePoint Server Publishing Infrastructure" features. Once these features are activated, you can add the Social Feed web part to the News Post Page. You can use the LikePost and UnlikePost methods to enable users to like and unlike a post, respectively. You can use the GetAllLikers method to get all the users who have liked a post.

    Here are the steps to enable Social Feed and add the web part to the News Post Page:

    1. Activate the "SharePoint Server Standard Site Collection features" and "SharePoint Server Publishing Infrastructure" features in Site Collection Features.
    2. Go to the News Post Page and edit the page.
    3. Click on "Insert" in the ribbon and select "Web Part".
    4. Under "Social Collaboration", select "Social Feed".
    5. Click on "Add".
    6. Save and publish the page.
    7. Once the web part is added, users can Like and Unlike News Posts, and you can capture all Likes using the Social Feed Manager API.

    Reference:

    https://learn.microsoft.com/en-us/sharepoint/dev/general-development/work-with-social-feeds-in-sharepoint#common-programming-tasks-for-working-with-social-feeds-in-sharepoint


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Mohamed Riyaz M 41 Reputation points
    2024-05-30T12:39:52.5766667+00:00

    I get An Unexpected error has occurred when I activate SharePoint Server Publishing Infrastructure" on a modern communication site. Please advise.