Skip to Content Skip to Menu

CB Activity + Auto Action + Custom trigger: Need link in Title

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
8 years 3 weeks ago #289553 by timstohr
Hi Kyle,

We have gotten the Custom Trigger, Auto Action and Activity to work satisfactorily. The question I had was how to create the title of the activity as a hyperlink?

ie the stuff I have marked in red should be as a hyperlink to something.

Attachments:

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48711
  • Thanks: 8320
  • Karma: 1447
8 years 3 weeks ago #289559 by krileon
Store the title with it already linked or you have to parse the individual activity and alter its display like CB Gallery and CB GroupJive do. To parse the activity and alter its display you need to use a code action on activity_onDisplayActivity then specify variables 1 - 8 as Reference Variables under the Parameters tab of your action. You can then modify them as needed in your code action using PHP. Specifically the variables for that trigger are as follows.

&$row, &$title, &$date, &$message, &$insert, &$footer, &$menu, &$extras, $stream, $output

To modify the title for example you'd do the below.

Code:
$vars['var2'] = 'MY NEW TITLE!';

Use conditions to limit what activity is modified by conditioning against [var1_type], [var1_subtype], etc..


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 or Create an account to join the conversation.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
8 years 3 weeks ago #289591 by timstohr
OK got it now. My feedback as user is that this process of two auto actions is somewhat complicated. It would be great to either be able to simply copy/paste the auto action from the system action or to have an extra field or something where you can put in the link.

That would be the easiest to understand.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48711
  • Thanks: 8320
  • Karma: 1447
8 years 3 weeks ago #289610 by krileon
You can save a copy of any of the system actions. They are also useful as working examples for various usages. I'll be adding more system actions in a future release once I've the XML structure figured out for them (at this time they're an absolute pain the maintain) which will allow me to easily add new system actions.

There's no way to have it just put a link somewhere. Not unless you make a unique way to parse it then extend the parser by acting on activity_onParse trigger. The parser is where hashes, mentions, etc.. are parsed out. You'd need something like [event:ID_HERE] then in your code you'd do preg_match then str_replace after building the URL.


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 or Create an account to join the conversation.

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
8 years 2 weeks ago #289907 by timstohr
Ah yeah,
Could you show what kind of code you have used for CB Gallery? That would give a nice starting point...

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48711
  • Thanks: 8320
  • Karma: 1447
8 years 2 weeks ago #289923 by krileon
CB Gallery handling of its activity content is all done in the below file.

components/com_comprofiler/plugin/user/plug_cbgallery/library/Trigger/ActivityTrigger.php

The template file it uses is as follows.

components/com_comprofiler/plugin/user/plug_cbgallery/templates/default/activity.php


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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum