Case study with CB Activity

4 years 11 months ago #312178 by activha
Replied by activha on topic Case study with CB Activity
I am coming back on this subject.

We have assets figured out like hotspot.[activity_id] with an autoaction setting an activity when hotspot is created.

Autoaction is
CB Activity
Trigger : AfterHostpotSave
User : automatic
Conditions:none
Actions:
Activity create
Asset : hotspot.[var2]
Title :=> [var6]
Owner : [var1]
Media : custom : [var5]

From the above post, I have then set a new auto action with :
CB Activity
Trigger : activity_OnAfterLikeStream
User : [var2_user_id]
Conditions:
[var3_asset] is regex /^hotspot./
[var3_user_id] > 0
Actions:
Activity create
Asset : [var3_asset].like
Owner :[var3_user_id]

This does not seem to display anything anywhere

Goal :
We have a display of Like and Activity stream on each hotspot page like this

What I want to achieve is :
For each like of the hotspot page => the like is displayed on the main activity page also => Jean likes this
For each comment of the page => the comment is displayed on the main activity page also under the main hotspot asset.

Can you help me ?

Please Log in to join the conversation.

4 years 11 months ago #312180 by krileon
Replied by krileon on topic Case study with CB Activity
There is no activity parsing for unknown assets. They're just treated like every day posts. It's not possible for it to be able to parse out activity for a page it doesn't know anything about. You need to implement display parsing in the core activity template page or just let it act like a normal activity post by supplying a Title and/or Message when creating the activity in CB Auto Actions.

The below for example should create an activity entry, but it has no display parsing of any kind so it's just going to look like a profile post.

Global
Triggers: activity_onAfterLikeStream
Type: CB Activity
User: Automatic
Access: Everybody
Conditions
1: [var3_asset] Is REGEXP /^hotspot./
Action
Mode: Activity
Method: Create
Asset: [var3_asset]
Owner: [var3_user_id]
Title: liked HOTSPOT
Date: [var3_date]
Load By: By Asset and Owner

This won't display on any activity stream unless that activity stream is setup to output the "hotspot.%" wildcard asset, "all" for all activity output, or is on a profile stream.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

4 years 11 months ago #312182 by activha
Replied by activha on topic Case study with CB Activity

You need to implement display parsing in the core activity template page


Do you have some special tags for this that I could add to the hotspot template ?

Knowing that each hotspot has already an activity on save, would it be possible to retrieve this activity data and display it in the second one ? media and links for instance

Please Log in to join the conversation.

4 years 11 months ago #312190 by krileon
Replied by krileon on topic Case study with CB Activity

Do you have some special tags for this that I could add to the hotspot template ?

All activity is passed through the core activity template file. You can add your own custom display code there. Specifically the below file.

/components/com_comprofiler/plugin/user/plug_cbactivity/templates/default/activity_core.php

Do not modify the default. Make a new folder in the templates folder then copy activity_core.php to it. Next within CB Activity select your template. Now you can begin adding changes to it.

When I rewrite the template files this will change. My plan is to add automated parsing for activity template files that can just be dropped in. So you'd have something like the below instead.

/components/com_comprofiler/plugin/user/plug_cbactivity/templates/default/activity/login.php

In your case you'd just have the below.

/components/com_comprofiler/plugin/user/plug_cbactivity/templates/default/activity/hotspot.php

Note this functionality doesn't exist yet, but is the plan.

Knowing that each hotspot has already an activity on save, would it be possible to retrieve this activity data and display it in the second one ? media and links for instance

Where an activity displays on a stream is entirely dependent on the asset the stream outputs. Add hotspot.% and the stream should always display all activity entries with that asset.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

4 years 11 months ago #312192 by activha
Replied by activha on topic Case study with CB Activity

Note this functionality doesn't exist yet, but is the plan.


We will wait for this functionality before implementing our template

Add hotspot.% and the stream should always display all activity entries with that asset.


Is it possible to retrieve data related to hotspot.% in the CB activity like auto action that I prepared as above ? is this a var ?

Please Log in to join the conversation.

4 years 11 months ago #312194 by krileon
Replied by krileon on topic Case study with CB Activity

We will wait for this functionality before implementing our template

That might be awhile. The activity_core.php will be sufficient for putting your custom activity display parsing. activity_core.php can handle access, display, and source parsing so it's a complete solution for custom activity display and access.

Is it possible to retrieve data related to hotspot.% in the CB activity like auto action that I prepared as above ? is this a var ?

No, CB Activity does not store source object data (it likely will store a serialized object in the future). It's parsed out from the asset. You can add custom parsing for that as well in activity_core.php in the parseSource function.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.175 seconds

Facebook Twitter LinkedIn