Client side dependencies

<link href="/Content/Styles/activityFeed.css" rel="stylesheet" type="text/css" />

<script src="/Scripts/json2.js" type="text/javascript"></script>
<script src="/Scripts/jquery-1.7.2.js" type="text/javascript"></script>
<script src="/Scripts/knockout-2.1.0.js" type="text/javascript"></script>
<script src="/Scripts/knockout.mapping-latest.js" type="text/javascript"></script>
<script src="/Scripts/activityFeed.js" type="text/javascript"></script>
<script src="/Scripts/moment.js" type="text/javascript"></script>

ActivityFeed control

ActivityFeed control contains a set of default templates that will be used to render the feed when no customizations are applied. This allows you to have a fully functional activity feed just by adding the control to a page.

<ow:ActivityFeed runat="server"/>

Customizing ActivityFeed settings

<ow:ActivityFeed runat="server" PageSize="10" />
<ow:ActivityFeed runat="server" FeedType="Personal|Global" TopicFilter="<%# Topic.FromUserId(Page.User.Identity.Name) %>" />
Note: Topic class has static FromUserId metohod, that converts userId into topic. EPiServer and SharePoint connectors have extensions methods to convert objects to topics.

ActivityFeed control properties:
  • FeedType _Personal - type of feed. Personal is used to display subscribed topics of current user. Global is used to display all updates.
  • PageSize - initial number of displayed updates and number of updates loaded using loadNextUpdates method
  • TopicsFilter - list of topics used to filter updates. (You can read more details about topics filter in Filtering updates by list of topics)
  • TopicFilter - shortcut for assigning single topics to TopicsFilter
  • NewTopics - list of topics, that will be added to published update
  • UpdatesSettings, CommentsSettings, TopicsFilterSettings - client render events (BeforeRemove, AfterRender and AfterAdd) for update, comments and topics filter (You can read more details about custom client events in Client render events).

Using ActivityFeed control in EPiServer

EPiServer's friendly url rewrite module fails to correctly handle some of knockoutJS templates used by ActivityFeed control. To workaround the problem, activity feed control uses reflection to detect the presence of EPiServer FriendlyUrlRewriter and adjusts rendered markup.

Last edited Jul 19, 2012 at 5:40 PM by mgrzyb, version 18


No comments yet.