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:
- Activate the "SharePoint Server Standard Site Collection features" and "SharePoint Server Publishing Infrastructure" features in Site Collection Features.
- Go to the News Post Page and edit the page.
- Click on "Insert" in the ribbon and select "Web Part".
- Under "Social Collaboration", select "Social Feed".
- Click on "Add".
- Save and publish the page.
- 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:
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.