CB Activity share link for individual post.

1 year 10 months ago #329714 by activha
Hello

I know that we will get the ability to share posts with CB Activity 6.0 but I'd like to ask you if it would be possible to have this ability right now with autoactions ?

For instance, could I add a menu link to the menu of any activity which would display the post on a standalone page with a specific itemid ? and maybe add another autoaction for meta tags ?

Can you tell me what trigger and mode to use for this ?

Thanks in advance

Please Log in to join the conversation.

1 year 10 months ago #329716 by krileon
Replied by krileon on topic CB Activity share link for individual post.
You can link to individual activity using the below URL structure, but it's not super reliable since the activity has no idea what stream it belongs to. In 6.0.0 each activity entry will be assigned its appropriate stream id so rebuilding from that is going to be significantly easier.

index.php?option=com_comprofiler&view=pluginclass&plugin=cbactivity&action=activity&id=ACTIVITY_ID

As for how you want to get that URL to the user that'd be entirely up to you. The activity_onDisplayStreamActivity trigger can be used to add new menu entries to an activity. Its available variables are as follows.

$_PLUGINS->trigger( 'activity_onDisplayStreamActivity', array( &$row, &$title, &$date, &$message, &$insert, &$footer, &$menu, $stream, $output ) ) );

So var7 would be the menu and is just an array of menu items. Adding a new link to that array will add a new menu item to activity.


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.

1 year 10 months ago - 1 year 10 months ago #329736 by activha
Replied by activha on topic CB Activity share link for individual post.
I thought that the existing menus were in the array but apparently I only have to add my own links in an empty array
$variables['var7'] = array( 'index.php?option=com_comprofiler&view=pluginclass&plugin=cbactivity&action=activity&id=[var1_id]' );

Thanks for the answer

Please Log in to join the conversation.

1 year 10 months ago #329737 by krileon
Replied by krileon on topic CB Activity share link for individual post.
That might override menu entries added by other integrations. Be sure to always add a new entry to the array instead of replacing the array. The below should work.

$variables['var7'][] = '<a href="index.php?option=com_comprofiler&view=pluginclass&plugin=cbactivity&action=activity&id=[var1_id]" class="dropdown-item">Share Activity</a>';


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.

1 year 10 months ago #329738 by activha
Replied by activha on topic CB Activity share link for individual post.
Thanks !
Also can I use JRoute in your code or do you have your own router ?

Please Log in to join the conversation.

1 year 10 months ago #329739 by krileon
Replied by krileon on topic CB Activity share link for individual post.
You can use the below to generate plugin links.

global $_CB_framework;

$variables['var7'][] = '<a href="' . $_CB_framework->pluginClassUrl( 'cbactivity', true, [ 'action' => 'activity', 'id' => $variables['var1']->id ] ) . '" class="dropdown-item">Share Activity</a>';


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.171 seconds

Facebook Twitter LinkedIn