5

Newsfeed (within a site, as a microfeed) works really nicely on Sharepoint, except for the fact that I can't limit the Newsfeed webpart to a certain height (or number of posts). It looks like it is stuck at 10 and there's no way to change this from the interface/webpart editor. In some instances, the webpart can be so tall and not very wieldly.

So, granted there's no way to tweak it from the Sharepoint UI, is there a way to do it using another tool/via programming method, so we can set the initial post number to, say, 5 posts only?

Many thanks!

  • Have you tried like the following link social.technet.microsoft.com/Forums/systemcenter/en-US/… – Supermode Jun 12 '14 at 4:47
  • their is no anwser on your posted link – Waqas Sarwar MVP Jun 12 '14 at 5:08
  • 1
    have you tried this one, it is talking about community site feed but may be work for you: social.msdn.microsoft.com/Forums/sharepoint/en-US/… – Waqas Sarwar MVP Jun 12 '14 at 5:16
  • Sorry for being late on progress. Thanks for the response, I've tried all of the suggested, but it is nowhere as "clean" as the original newsfeed. I'm still convinced that somebody may come up with an idea on how to hack the existing newsfeed in order to show only 5, w/o writing another list to draw the content for display as per Saumlim advice below, since adding to the newsfeed will post yet another UX concern. – Wonderboy Jun 18 '14 at 7:02
  • Supermode: Yes, the guy who posted the solution was answering a Sharepoint 2013 with a Sharepoint 2010 solution (which doesn't work or exist) >_< It was a good try though. – Wonderboy Jun 18 '14 at 7:10
2

You can first hide the divs after the amount of posts you want to be visible. And then you can show them when the user clicks "Show more posts":

$('.ms-microfeed-thread:gt(2)').hide(); //hides all posts after the three latests
$('#ms-MoreThreadsButtonLabel').click(function (){$('.ms-microfeed-thread').show();}); // sets a click function on the morethreads button to show them again
1

As there are no OOB methods to achieve it, there is a workaround like this: get the posts into a list and do the paging in this list instead.

We can do it like this: Create a List with the necessary column match the content of post, i.e. text, picture, then add it into the page. Then use some code to retrieve posts in Newsfeed, get the different types of value from the post and insert into the list.

Now we can do the paging in this list.

The link below provides methods to access the social feed:

http://msdn.microsoft.com/en-us/library/jj163977.aspx

How to Limit the number of items in a view:

http://technet.microsoft.com/en-us/library/cc768269.aspx

Source: http://social.msdn.microsoft.com/Forums/sharepoint/en-US/545b139c-8c07-48bc-93e4-3b1ef5f4bad2/community-site-newsfeed-posts?forum=sharepointdevelopment

I have tried this & has worked.

  • Thanks for the response, however, this has it's own UX concerns, since getting the view ready to show the 5 feeds but doesn't provide the user access to write to the newsfeed easily. I did, still, upvote your response to this as it's the only solution I found so far outside via google as well. I'm still forever hopeful something else will come along that will fit this bill. – Wonderboy Jun 18 '14 at 7:05
  • Please start a bounty so that your question becomes more visible. – neo269 Jun 22 '14 at 8:34
  • I don't have reputation to do that, sorry! – Wonderboy Jun 23 '14 at 3:11
1

Just as a follow up to David's suggestion;
this shows only latest 3 posts

<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script> 
<script> 
$(document).ready(function(){ 
$('.ms-microfeed-thread:gt(2)').hide(); //hides all posts after the three latests
$('#ms-MoreThreadsButtonLabel').click(function (){$('.ms-microfeed-thread').show();}); 
});
</script>
  • Works like a charm on SP2013. Thanks for the code snippet, – evictorov Oct 29 '18 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.