+ Start a Discussion
pranav shah 40pranav shah 40 

How to hide/show chatter feed sections using toggle dynamically on community page

Dear All,

I have requirement in my community page that the feed and feed  publisher which we drag and drop on community page ,needs to have show/hide functionality for those section 
how we can implement it using aura component??
Best Answer chosen by pranav shah 40
AnudeepAnudeep (Salesforce Developers) 
You can do something like this
<div aura:id="feedContainer" class="feed-container">
        <forceChatter:feed />
    </div>
 
({
    hide : function(component,event,helper){
        var elements = document.getElementsByClassName("feed-container");
        elements[0].style.display = 'none';
    },
    
    show : function(component,event,helper){
        var elements = document.getElementsByClassName("feed-container");
        elements[0].style.display = 'block';
    }
})

Another option is to do it with styles. I recommend reviewing this post although the example provided references Visualforce

Let me know if this helps, if it does, please close the query by marking it as solved. It may help others in the community. Thank You!

All Answers

VinayVinay (Salesforce Developers) 
Check below details.

https://developer.salesforce.com/forums/?id=9060G0000005c2VQAQ
https://salesforce.stackexchange.com/questions/251351/remove-chatter-options-from-a-salesforce-record-page

Thanks,
AnudeepAnudeep (Salesforce Developers) 
You can do something like this
<div aura:id="feedContainer" class="feed-container">
        <forceChatter:feed />
    </div>
 
({
    hide : function(component,event,helper){
        var elements = document.getElementsByClassName("feed-container");
        elements[0].style.display = 'none';
    },
    
    show : function(component,event,helper){
        var elements = document.getElementsByClassName("feed-container");
        elements[0].style.display = 'block';
    }
})

Another option is to do it with styles. I recommend reviewing this post although the example provided references Visualforce

Let me know if this helps, if it does, please close the query by marking it as solved. It may help others in the community. Thank You!
This was selected as the best answer
pranav shah 40pranav shah 40
Dear Anudeep,

please find below screensho,t when i click on refresh icon below comment post, nothing gets populated, it gives me this error 

An internal server error has occurred Error ID: 1255232263-17019 (2122198180)

User-added image