none
Limiting the height of Site Feed webpart in sharepoint 2013

    Question

  • I have a site feed webpart which goes on extending after feeds from user,i want to fix the size of site feed which cant be done using the available features ,also is it possible to having paging in site feed webpart?
    Wednesday, November 13, 2013 10:25 AM

Answers

  • Hi,

    I had the same requirement and I solve by customizing css, you can find solution here:

    http://josharepoint.com/2014/06/09/branding-tip-custom-style-in-newsfeed-and-site-feed-webpart-in-sharepoint-2013/

    Hope that helps!


    José Quinto Zamora SharePoint and Search Specialist MCITP and MCPD in SharePoint 2010 http://joSharePoint.com

    • Marked as answer by Aditya Gandhe Friday, June 13, 2014 11:25 AM
    Monday, June 09, 2014 11:01 AM
  • Hi,
    From your description, you want to limit the height of site feed web part.

    By design, there are 10 posts at most show 10 posts when page loaded.
    If you want limit the height of site feed web part, we can use jQuery to achieve it.
    The following code snippet show 2 posts when page loaded.

    $(document).ready(function () {
       var limit=2;
       $("#ms-feedthreadsdiv .ms-microfeed-thread").each(function(i){
           if(i>=limit){
              $(this).addClass("ms-hide");
           }
       });
    });

    Then we can override the click event of the “SHOW MORE POSTS” button.

    If you want to paging and show what you want, I suggest you to customize a Newsfeed web part.

    Best Regards


    Dennis Guo
    TechNet Community Support

    Monday, November 18, 2013 9:05 AM
    Moderator

All replies

  • Hi,
    From your description, you want to limit the height of site feed web part.

    By design, there are 10 posts at most show 10 posts when page loaded.
    If you want limit the height of site feed web part, we can use jQuery to achieve it.
    The following code snippet show 2 posts when page loaded.

    $(document).ready(function () {
       var limit=2;
       $("#ms-feedthreadsdiv .ms-microfeed-thread").each(function(i){
           if(i>=limit){
              $(this).addClass("ms-hide");
           }
       });
    });

    Then we can override the click event of the “SHOW MORE POSTS” button.

    If you want to paging and show what you want, I suggest you to customize a Newsfeed web part.

    Best Regards


    Dennis Guo
    TechNet Community Support

    Monday, November 18, 2013 9:05 AM
    Moderator
  • I've tried using this Jquery script but all items in the post disappear. I am also not allowed to post to the newsfeed thereafter. It comes up with an error that the newsfeed has been removed. After removing the script, all goes back to normal.

    Am I missing something?

    Sunday, February 09, 2014 8:50 PM
  • Hi,

    I had the same requirement and I solve by customizing css, you can find solution here:

    http://josharepoint.com/2014/06/09/branding-tip-custom-style-in-newsfeed-and-site-feed-webpart-in-sharepoint-2013/

    Hope that helps!


    José Quinto Zamora SharePoint and Search Specialist MCITP and MCPD in SharePoint 2010 http://joSharePoint.com

    • Marked as answer by Aditya Gandhe Friday, June 13, 2014 11:25 AM
    Monday, June 09, 2014 11:01 AM
  • Hi Jose,

    Thanks for sharing your css


    Friday, June 13, 2014 11:25 AM
  • What do you add to the script to hide the "SHOW MORE POSTS" link?  I'm assuming that sharepoint thinks they are still there so it doesn't do anything when you click it.  But I did notice if you click the newsfeed button it shows them all.  So if there was a way to take away the default "SHOW MORE POSTS" and add your own that has the same link as Newsfeed on the top then it would work properly.

    Thanks in advance!

    Wednesday, May 20, 2015 9:41 PM