+ Start a Discussion
Jacky LeeJacky Lee 

how to use the Visualforce chatter:feed component to display one feedItem (instead of the whole feed)

Hi guys,

I'm wondering if the chatter:feed component in VF can show a single feed item in that feed rather than the whole feed. That is, a single post that has the All Updates > This Update marker at the top.

The component does use the entityId attribute so it makes sense that it shows the record's entire feed. But it looks like the url for a feedItem takes in two parameters: salesforce.com/a0V6F00000ZOer8?fId=0D55D000003SNb0, one for the record and one for the feedItem. 

For context, the use for this on my page is that I have a list of records, each row having a button. The button uses jquery to open a popup window with an iframe of that record's chatter feed (which is just another VF page with chatter:feed). I'm displaying the whole feed, but I only need a single post that has a particular topic. Should also be able to post/comment.

Any suggestions on other ways I can display the filtered feedItem are very welcome :)


Best Answer chosen by Jacky Lee
NagendraNagendra (Salesforce Developers) 
Hi Jacky,

Since you're looking for only a single FeedItem record, just do a SOQL query for the FeedItem record and render the data on the screen. A FeedItem is a record just like any other; the VF component you're talking about just makes it easier to render complex UI pieces. You're rendering just one FeedItem, so it's probably easier to do the simple query.

Having said that, if you want to do some more finely-grained work, check the Apex ConnectAPI namespace, especially the FeedElement section:  Hope this helps.

Kindly mark this as solved if it's resolved.