Hide Chatter JS Working, Where to Store JS Snippet?

  • 1
  • Question
  • Updated 6 years ago
Archived and Closed

This conversation is no longer open for comments or replies and is no longer visible to community members. The community moderator provided the following reason for archiving: Old Forum Posts - bugs that have been fixed.

I am trying to auto-hide the Chatter feed on the homepage.  It is quite intrusive, especially when you are trying to include Skuid components.

I can get this to work within the JS console, but not in a script tag within an HTML component or a Skuid JS snipped / inline JS.

var e = document.getElementById("showFeedLink");     

if(e.style.display == "none"){
   chatter.getFeed().toggle('{"subjectId":"window.UserContext.userId","feedType":"NEWS"}', false);
}

Any ideas?
Photo of Jacob Flatter

Jacob Flatter

  • 1,532 Points 1k badge 2x thumb

Posted 6 years ago

  • 1
Photo of Jacob Flatter

Jacob Flatter

  • 1,532 Points 1k badge 2x thumb
This works, although small bug about browser scrolling down after iframe load:

<script type="text/javascript">function hidechatter()
{
     var e = document.getElementById("showFeedLink");
     if(e.style.display == "none"){ 
           chatter.getFeed().toggle('{"subjectId":"window.UserContext.userId","feedType":"NEWS"}', false);
    }
}
window.setTimeout("hidechatter()", 2000);
</script>

Insert this before the iframe tag in a Home page component, HTML area.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,968 Points 20k badge 2x thumb
We use a simpler technique in our home page components.  Before the Iframe tag we put the following:  

<style>.bPageTitle .metadata { display:none; }</style>

This means that Chatter is there under the covers,  but its pretty quickly blocked out by the Skuid content. 
Photo of Jacob Flatter

Jacob Flatter

  • 1,532 Points 1k badge 2x thumb
Cool, That works too.  

Only issue is if you would like chatter present, simply with the feed hidden, not entirely gone.


This conversation is no longer open for comments or replies.