View Feed

Use this tag to display the activity items in a template.

{exp:activity_feed:feed}{/exp:activity_feed:feed} 

Table of Contents


Parameters

type

Accepted values:

Member Module

  • members - includes member_joins
  • member_joins - when someone joins your site

Weblog Module

  • weblogs - includes entries and comments
  • weblog_entries - when a blog post goes live
  • weblog_comments - when someone posts comment

Discussion Forum Module

  • forums - includes topics and posts
  • forum_topics - when someone starts a new forum topic
  • forum_posts - when someone replies to a forum topic

Solspace Favorites Module

  • favorites - alias for ‘favorites_entries’
  • favorites_entries - when someone saves an entry as a favorite

Solspace Friends Module

  • friends - includes all supported Friends Module activity listed below
  • friends_group_joins - when someone joins a Friends group
  • friends_group_wall_comments - when someone comments on a Friends group wall
  • friends_group_entries - when someone posts or associates a Channel entry with a Friends group
  • friends_group_entry_comments - when someone posts a comment on a Friends group Channel entry
  • friends_status_updates - when someone posts a Friends status update (lists friends’ statuses, excluding private status updates from non-reciprocal friends, similar to exp:friends:status tag in Friends Module).  if user is not logged in AND no member_id is specified, a public stream will show (which excludes private updates).

CartThrob Module

  • cartthrob -  alias for ‘cartthrob_orders’
  • cartthrob_orders - when someone purchases an item in your CartThrob store (requires tracking of purchased items in a channel.  also requires purchased_items_channel and purchased_items_entry_id_field parameters, explained below)

ExpressionEngine 1.6.x Only
The following modules and their respective parameters are only supported in EE 1.6.x, not EE 2.x.  Once those modules are updated to support EE 2.x, we will release an update to the Activity Feed module.

Photo Gallery Module

  • galleries - includes photos and comments
  • gallery_photos - when a photo gets uploaded into the photo gallery
  • gallery_comments - when someone posts a comment on a photo

Solspace Video Module

  • videos - includes entries
  • video_entries - when a new video is added

d/d User Groups Module

  • user_groups - includes joins, topics, and replies
  • user_groups_joins - when someone joins a User Group
  • user_groups_topics - when a topic is started in a User Group
  • user_groups_replies - when someone replies to a topic in a User Group

member_id

group_id

EE Member Group ID, with multiple separated by a “|”

weblog

Enter the short name of a weblog, or multiple weblog names separated by a “|”

Example:  weblog=“bugs|features”

weblog_id

Enter the ID of a weblog, or multiple weblog IDs separated by a “|”

weblog_status

Enter the status you want to include for weblog_entries and weblog_comments.  Separate multiple statuses with a “|”

user_group_id

Enter the ID of a User Group.  Used to limit User Groups Module content to a specific group.

friends_group_id

Enter the ID of a Friends Module group.  Used to limit Friends Module group content to a specific group.  Separate multiple statuses with a “|”

show_friends

By default, only activity for the users specified in the member_id parameter are shown.  Set this flag to ‘yes’ to include the activity for the user’s reciprocal friends.

Requires Solspace Friends Module.  Defaults to ‘no’.  Accepted values are ‘no’, ‘yes’

photo_status

Enter the status you want to include for gallery_photos and gallery_comments.  Separate multiple statuses with a “|”

Accepted values:  ‘o’, ‘c’

purchased_items_channel

CartThrob allows you to track purchased items in a Channel (see the CartThrob docs about it here).  Enter the Channel’s short name into this parameter (e.g purchased_items_channel=“store_purchased_items”).

Required field to display CartThrob purchases.

purchased_items_entry_id_field

The Channel specified in the purchased_items_channel parameter has a custom field that holds the Purchased Item Entry ID.  Enter the field’s short name into this parameter (e.g. purchased_items_entry_id_field=“item_entry_id”).

Required field to display CartThrob purchases.

show_future_entries

Used for channel/weblog entries and comments.  Default is ‘no’.  Accepted values are ‘yes’ and ‘no’

limit

Variables

The following are available in this tag.

actor_member_id

actor_screen_name

actor_photo

actor_avatar

action

item_id

item_title

item_url_title

parent_reference

This is the text that refers to the parent item.  For example, if Joe User commented on the blog post ‘Test Post’, the text ‘on the blog post’ would be your parent_reference.  These values can be customized for each activity type in the module’s preferences section.

parent_id

parent_title

parent_url_title

grandparent_reference

This is the text that refers to the grandparent item.  For example, if Joe User commented on the blog post ‘Test Post’ in the blog ‘Weblog’, the text ‘in the blog’ would be your grandparent_reference.  These values can be customized for each activity type in the module’s preferences section.

grandparent_id

grandparent_title

grandparent_url_title

item_date format=”“

Parsed just like standard entry_dates in EE (See the official date docs here).

Note: We recommend NOT using the format=”“, and instead using the Timesince Plugin to display the amount of time that has elapsed since the activity item was done.  This is the method we used in the example below.

parent_date format=”“

Parsed just like standard entry_dates in EE (See the official date docs here).

Note: We recommend NOT using the format=”“, and instead using the Timesince Plugin to display the amount of time that has elapsed since the activity item was done.  This is the method we used in the example below.

Download the Timesince Plugin
(from Steve P. Sharpe at Gleam Studios)

Conditionals

if type=”“

Since most of the different feed types require different styling or links within them, we recommend you use this conditional to determine what to display.  See the example below for this type of use.

See the type list in the parameter section above for all accepted values.  You can use all of them except for the ones in bold.

All variables

Simple Example

actor_screen_name: Joe User
action: commented
parent_reference: on the blog post
parent_title: Blog Post
grandparent_reference: in the blog
grandparent_title: The Weblog

Put it all together:
Joe User commented on the blog post ‘Blog Post’ in the blog ‘The Weblog’ - 27 minutes ago

{exp:activity_feed:feed type="weblog_comments" limit="5"}
    {actor_screen_name} {action} {parent_reference} 
'{parent_title}' {grandparent_reference} '{grandparent_title}' {item_date format=' %l, %F %d, %Y '}
{
/exp:activity_feed:feed} 

Advanced Example

Requires Timesince plugin.

<ul class="activity-feed">
    
{exp:activity_feed:feed limit="5"}
        
<li>
            <
a href="/members/profile/{actor_member_id}/">
                
{if actor_photo != ""}
                    
<div class="feed-image">
                        <
img src="/images/member_photos/{actor_photo}" width="30" height="30" />
                    </
div>
                
{if:else}
                    
<div class="feed-image">
                        <
img src="/images/site_images/default-user.jpg" width="30" height="30" />
                    </
div>
                
{/if}
            
</a>
            <
div class="feed-text">
                <
a href="/members/profile/{actor_member_id}/">
                    
{actor_screen_name}
                
</a{action} 
                {if type 
== "member_joins"}
                    
<a href="/">Adoptive Families Circle</a>
                
{/if}
                {if type 
== "weblog_entries"}
                    
<a href="/blogs/post/{item_url_title}/">
                        
{item_title}
                    
</a{parent_reference} 
                    
<a href="/blogs/blog/{parent_url_title}/">
                        
{parent_title}
                    
</a>
                
{/if}
                {if type 
== "weblog_comments"}
                    {parent_reference} 
                    
<a href="/blogs/post/{parent_url_title}/#comment-{item_id}">
                        
{parent_title}
                    
</a>
                
{/if}
                {if type 
== "forum_topics"}
                    
<a href="/forums/viewthread/{item_id}/">
                        
{item_title}
                    
</a{parent_reference} 
                    
<a href="/forums/viewforum/{parent_id}/">
                        
{parent_title}
                    
</a>
                
{/if}
                {if type 
== "forum_posts"}
                    {parent_reference} 
                    
<a href="/forums/viewreply/{item_id}/">
                        
{parent_title}
                    
</a>
                
{/if}
                {if type 
== "gallery_photos"}
                    
<a href="/photos/full/{item_id}/">
                        
{item_title}
                    
</a{parent_reference} 
                    
<a href="/photos/album/C{parent_id}/">
                        
{parent_title}
                    
</a>
                
{/if}
                {if type 
== "gallery_comments"}
                    {parent_reference} 
                    
<a href="/photos/full/{parent_id}/#comment-{item_id}">
                        
{parent_title}
                    
</a>
                
{/if}
                {if type 
== "video_entries"}
                    
<a href="/videos/watch/{item_id}/">
                        
{item_title}
                    
</a>
                
{/if}
                {if type 
== "user_groups_joins"}
                    
<a href="/groups/group/{item_url_title}/">
                        
{item_title}
                    
</a>
                
{/if}
                {if type 
== "user_groups_topics"}
                    
<a href="/groups/topic/{item_id}/">
                        
{item_title}
                    
</a{parent_reference} 
                    
<a href="/groups/group/{parent_url_title}/">
                        
{parent_title}
                    
</a>
                
{/if}
                {if type 
== "user_groups_replies"}
                    {parent_reference} 
                    
<a href="/groups/topic/{parent_id}/#reply-{item_id}">
                        
{parent_title}
                    
</a{grandparent_reference} 
                    
<a href="/groups/group/{grandparent_id}/">
                        
{grandparent_title}
                    
</a>
                
{/if}
                {if type 
== "favorites_entries"}
                    {parent_reference} 
                    
<a href="/blogs/post/{parent_url_title}/">
                        
{parent_title}
                    
</a{grandparent_reference} 
                    
<a href="/blogs/blog/{grandparent_url_title}/">
                        
{grandparent_title}
                    
</a>
                
{/if}
                {if type 
== "friends_group_joins"}
                    
<a href="{path=}/groups/index/{item_id}/">
                        
{item_title}
                    
</a>
                
{/if}
                {if type 
== "friends_group_wall_comments"}
                    {item_title}
                {
/if}
                {if type 
== "friends_group_entries"}
                    {item_title} {parent_reference} {parent_title}
                {
/if}
                {if type 
== "friends_group_entry_comments"}
                    {item_title} {parent_reference} {parent_title} {grandparent_reference} {grandparent_title}
                {
/if}
                {if type 
== "friends_status_updates"}
                    {item_title}
                {
/if}
                
                
<br/>
                <
span class="feed-meta">
                    
{exp:timesince}{item_date}{/exp:timesince}
                
</span>
            </
div>
        </
li>
    
{/exp:activity_feed:feed}
</ul

Category:Activity Feed -> Tags

Categories: