Tuesday, August 5, 2014

Showing My Site's Newsfeed in SharePoint Web Application Programmatically

Introduction

 In My Site (SharePoint 2013), We have an option to track our activity using News Feed webpart. This webpart will show all the activities of logged in person in Mysite. Let see the note about Newsfeed webpart


NewsFeed

NewsFeed is the user's social hub where user can see the updates from people, documents, sites and tags which is followed by user. It displays the feeds of recent activities related to a user's specified interests. User can customize their interest by adding (Follow) / removing (Unfollow) colleagues, tags and documents.

This is short note about NewsFeed webpart. Let's see how we can integrate this into normal SharePoint site collection programmatically.

After the creation of farm solution using visual studio. Just add your sitepage under SitePages module.


Add Microsoft.SharePoint.Portal Reference


Then, Register portal dll in created sitepage.

<%@ Register TagPrefix="Portal" Namespace="Microsoft.SharePoint.Portal.WebControls" Assembly="Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

Paste the MicroFeedwebpart at where you want to display it within page. This webpart is used to get the feeds which is in My Site Newsfeed

<Portal:MicroFeedWebPart runat="server" id="sfwNewssFeed" ChromeType="none"></Portal:MicroFeedWebPart>  

That's all. Deploy your solution in SP web application. Newsfeed will display in SitePage.


No comments:

Post a Comment