Question

I would like to display the content of the "Sites I'm following" web part on my main page.

I know that the web part itself can not be exported.

Is there any way of doing this?

Was it helpful?

Solution

Yes. You can achieve this by simply creating a REST api call to fetch the Sites I'm following list data inside a Script Editor Web Part or Content Editor Web Part.

Take a look at this article, it has the explained code for retrieving the list of sites I'm following.

Refer below snippet code that you can use if above link doesn't work:

var siteURL = "<your site url>";
$.ajax({  
   url: siteURL + "/_api/social.following/my/followed(types=14)",  
   headers: {   
      "accept": "application/json;odata=verbose"  
   },  
   success: function(){ /* Your Success function Goes Here - DOM Manipulation to show the results of sites */},  
   error: function() { /* Your Error function Goes Here*/}
});  

You can check this MSDN article for more reference.

OTHER TIPS

Another approach could be to leverage the content by search or search results webparts showing a list of sites that is filtered by the list of sites the user is following. Although OOTB the search web parts don't include a query variable to establish this, I have created a content editor / script editor based solution to facilitate this using a custom token "{FollowedSites}". See my answer here: SharePoint 2013: Filter search results to only display content that I'm following

If this works, maybe you could then customize the search webparts further yourself?

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top