Ardour Digital - Specialists in development, consultancy, and training for Telligent community and ASP.NET application development

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:

Telligent.Evolution.Api.Plugins.ActivityStories.BlogPostStoryType
Telligent.Evolution.Api.Plugins.ActivityStories.ExternalMessageStoryType
Telligent.Evolution.Api.Plugins.ActivityStories.ForumThreadStoryType
Telligent.Evolution.Api.Plugins.ActivityStories.FriendshipStoryType
Telligent.Evolution.Api.Plugins.ActivityStories.GroupStoryType
Telligent.Evolution.Api.Plugins.ActivityStories.GroupUserJoinedStoryType
Telligent.Evolution.Api.Plugins.ActivityStories.MediaStoryType
Telligent.Evolution.Api.Plugins.ActivityStories.StatusMessageStoryType
Telligent.Evolution.Api.Plugins.ActivityStories.UserAvatarStoryType
Telligent.Evolution.Api.Plugins.ActivityStories.UserJoinedStoryType
Telligent.Evolution.Api.Plugins.ActivityStories.WikiPageStoryType
Telligent.Evolution.Api.Plugins.ActivityStories.AchievementStoryType

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.


NOTE:
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.

Ardour Digital can help you get the most out of Telligent Community. Providing development, training, and advice.

To find out more email hello@ardourdigital.co.uk or call +44 (0)177 3254 150.


Comments

Erik P. Ernst

Hi Rhys,

Can this method also be used to change the searchresult html output (viewhtml)?

  • Erik P. Ernst
  • October 29, 2015

Rhys Godfrey

Erik - You could probably use a similar approach, but would have to apply it to the Content Type plugins, these are used a lot more widely so the risk of error and complications is a lot higher.

Have you looked at the Render Search Indexing event - PublicApi.SearchIndexing.Events.Render (community.telligent.com/.../46018.searchindexing-in-process-api-service) - looks like that can be used to modify the Html used when viewing search results.

  • Rhys Godfrey
  • October 29, 2015

Erik P. Ernst

Love that we "can" change everything this way in Telligent. But I don't really understand why it has to be so "difficult" to change the view of something as essential as the activity stream and search results! All I really want to do is to make sure that the application name always is displayed, and that the group name only is displayed when and activity is displayed outside of the group.

Using the "resource template" field of the plugin, then this would have been possible. Really just need to add additional {x} options to the template.

  • Erik P. Ernst
  • October 31, 2015

Ben Tiedt

We're going to make this easier. The approach that we'll use will leverage the plugin-defined-widget capabilities introduced in 9.0 to provide widget-based rendering of content views (search, aggregate views) and activity stories. Then, these widgets will be exposed for editing, versioning, previewing, etc within the new Widget Studio. The plugin capability to render widgets is included in 9.0, but the conversion of existing content/activity-story types will be in a future release.

  • Ben Tiedt
  • November 04, 2015

Erik P. Ernst

Sounds good Ben, did wonder what those "rendering" strings where in the widgets. But I couldn't find that they where used anywhere in 9.0.

  • Erik P. Ernst
  • March 02, 2016


Leave a Comment