Skip to Content Skip to Menu

🌟Discover the Joomla AI Plugin that wrote its own story! - CB Editor Assistant 1.1now for Joomla 3, 4 & 5!
✍️ 5-Day Free Trial, then 🎯 save up to 30% with our 🛍️ Intro Offer (First 50 users, ends Dec. 25th)

[#6809] Here is another case we try to set but we are stuck.

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 392
  • Thanks: 36
  • Karma: 2
  • Add-ons
7 years 2 months ago - 7 years 2 months ago #297835 by liaskas
We need our members to be able to comment on our articles and The comments to show on the activity stream.

What we have done so far...

- Content - CB Activity plugin is published and the commenting field shows fine on article pages.
- Created a new auto action that is supposed to show the comment in the activity stream.

Auto action settings:
Triggers: activity_onAfterCreateStreamComment - activity_onAfterUpdateStreamComment
Type: CB Activity
User: Automatic
Access: Everybody

Conditions:
[var3_asset] is REGEX /^article./

Action:
Mode: Activity
Method: Create
Published: (blank)
Asset: article.ARTICLE_ID
Title: New comment has been made on article
Message: [username] has posted a new comment on article "[here we need to show the article title]".

We are able to get the article ID by [var3_asset].
We are able to get the comment by [var3_message]

How can we get the arrticle title?
Last edit: 7 years 2 months ago by krileon. Reason: Added [#6809] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48609
  • Thanks: 8300
  • Karma: 1446
7 years 2 months ago #297838 by krileon

How can we get the arrticle title?

You can't, that information isn't stored by the comment. Ideally you'd need a trigger to parse the display code of the activity entry and take the article id from the asset and dynamically output the title. That's how core activity, CB Gallery, etc.. activity is done. You could technically add that code directly to the core activity template file below.

components/com_comprofiler/plugin/user/plug_cbactivity/templates/default/activity_core.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.

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 392
  • Thanks: 36
  • Karma: 2
  • Add-ons
7 years 2 months ago #297857 by liaskas
Thank you for your reply krileon but... i am not so good at all this.

So what i can do is search. Where? Right here in this forum.

I searched for examples of a trigger to parse the display code of the activity entry and take the article id from the asset and dynamically output the title, without any luck.

I searched for examples of how to add code directly to the core activity template file... components/com_comprofiler/plugin/user/plug_cbactivity/templates/default/activity_core.php

but everything i found stops at...

"
add that code directly to the core activity template file below.

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

We have the article ID from the asset in the stream!
Can we have an example of how to dynamically output the title?

I am sorry for being such a newbie in all this. Everything i do is from trying and searching your post replies.

Thank you!

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48609
  • Thanks: 8300
  • Karma: 1446
7 years 2 months ago - 7 years 2 months ago #297865 by krileon
The source object is typically available as [var2] for that trigger. However, that is only if there is code to parse the asset into a source object. In this case that does not exist as it has no idea what extension the article belongs to. So the only way to have the information you're wanting is to write the code for that functionality (either to set the source object or parse the activity display).

With that said article comments are built into CB Activity so will add article source parsing so you'll be able to do something like [var2_title] on that trigger to get the article title. Will see about having this implemented for a new build for today.

forge.joomlapolis.com/issues/6809


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.
Last edit: 7 years 2 months ago by krileon.
The following user(s) said Thank You: liaskas

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

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 392
  • Thanks: 36
  • Karma: 2
  • Add-ons
7 years 2 months ago #297867 by liaskas
Thank you Krileon!
We 'll be waiting for the new build. Thank you again!

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

  • timstohr
  • timstohr
  • OFFLINE
  • Posts: 1091
  • Thanks: 56
  • Karma: 9
7 years 2 months ago #297926 by timstohr
Just tried to implement it and it did not work. I cannot get either the title out nor can I get the comment itself out...

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

Moderators: beatnantkrileon
Powered by Kunena Forum