Currently there is only one standard template available for all UR activities.
How can I distinguish an activity template based on relationship type ?

1) If there is a "fan" relationship show "X is fan of Y"
2) If there is a "friend" relationship show "A" and "B" are now friends

The only way currently available is "X" is now related to "Y" by "relation ship type" which is not user friendly at all. There is no way to differentiate based on "type" of relationship.

I am writing this as a bug since, in 1.x there were individual activity templates available per UR type which made it easier to customize this.

Comments

Scott Reynolds’s picture

Status: Active » Postponed (maintainer needs more info)

The only way currently available is "X" is now related to "Y" by "relation ship type" which is not user friendly at all

. There is no way to differentiate based on "type" of relationship.

Those two statements are really confusing. The first one reads, "you can create a template per relationship type" and the other says "There is no way to create a template based per relationship type"

Please explain.

ajayg’s picture

Status: Postponed (maintainer needs more info) » Active

What I mean is there is only one template possible which creates issue when a site has one way relationships "fan/follower" and two way relationship "friends" at the same time.

Let use say you define the template as "[requester] and [requestee] are now [relationship type]". It works fine for two way relationship. "A and B are now friends". But "X and Y are now fan/follower" is not user friendly as it is not clear who is who's fan. In that case "X is now fan of Y" would be more appropriate. In that case we need a template "[requester] is [relationship type] with [requester] is what is required for this activity templates. Now in English this could possibly work with two way relationship too (A is now friend of B). But it is not always possible in 1) other languages or 2) Other relationships. So basically these two types of relationships need different templates.

The token required are same in both cases just need multiple templates based on relationship ID.

So generically have template 1 for relationship type 1, template 2 for relationship type 2 etc. eg,

Friends (RTID=1) : "[requester] and [requestee] are now [relationship type]".
Fans(RTID=2): "[requester] is now [relationship type] of [requestee]".

BenK’s picture

Subscribing...

Scott Reynolds’s picture

Project: Activity » User Relationships
Version: 6.x-2.x-dev » 6.x-1.x-dev
Category: bug » feature

Activity has a type system for this. Its already setup. UR just has to use it. Look at Flag and how it does it. The node integration, comment integration and user integration does this as well. All of these define types to be used.

Sorry but for Activity2, we as the maintainers are not maintaining other module integrations. Its a decision I regret, because everyone thinks we should so they open issues here, and I end up writing most of the patches anyways.

This is a decision we will revisit for the Drupal7 port.

Scott Reynolds’s picture

In hook_activity_info() define the type_options.

Then write a hook_activity_type_check($token_objects, $types).

See: http://drupalcode.org/viewvc/drupal/contributions/modules/activity/DEVEL...

for examples.

mrf’s picture

Status: Active » Postponed

I am postponing any 6.x feature requests that don't have a current applicable patch to help sort the large list of open features.

Please feel free to set to 'needs review' once a patch is included.