When browsing a community site created with Telligent Community (formally Zimbra Social) one of the first things you are likely to see is the Activity Stream. This shows a summary of the recent Activity that has taken place.
Since Telligent Community 7.0 these stories have been controlled by IActivityStoryType plugins. The content shown can be customised by overriding the standard implementation and updating the GetViewHtml method. In Telligent Community 8.5 the following Story Types are available:
The example in this post will change the BlogPostStoryType, but it should be possible to apply the same approach to any of the story types.
The standard blog post story creates a story for every new blog post, similar to this:
A custom class can be created, this must inherit the story type and the IActivityStoryType and IPlugin interfaces. The GetViewHtml, Name and Description members should be explicitly implemented. All other members can use the default implementation.
This class will require references to the Telligent.Evolution.Components, Telligent.Evolution.Core and Telligent.Evolution.Api DLLs.
The code should be built, and the DLL containing the class copied to the bin folder of the Community website. If you navigate to the Manage Plugins page (Control Panel > Site Administration > Manage Plugins) you should see the custom Blog Activity Story plugin available:
The two plugins should not be enabled at the same time! To switch to the customised version, untick the checkbox next to the “Blog Post Activity” plugin, and instead check the box next to the “Blog Post Activity – Custom” plugin.
Reloading the activity feed the story will now be using our custom display:
The display of the message can be customised to your requirements by changing the logic in the GetViewHtml method to meet your needs.
You can use Telligent.Evolution.Extensibility.Api.Version1.PublicApi.Language for handy methods for formatting strings and dates.
Do not use this method for customising activity feeds if you are using the XML based emails with Telligent Community 8.x as this breaks Daily and Weekly digests. If you are using a fresh install of version 8.0+ then this should not be an issue. If you upgraded from an earlier version of Telligent Community and still have the Languages/en-US/Emails/emaildigest_group.xml file in your website or Job Service folder this approach may stop digest emails being sent (the Event Log will incorrectly show the email as sent, but it will not have been). To solve this you will have to switch to the new style digest emails before implementing this. This is not a problem in 7.x.