function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
pranavshahpranavshah 

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 pranavshah
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
pranavshahpranavshah
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