Skip to Content Skip to Menu

CB Comments on a JEvents Event?

  • kdave321
  • kdave321
  • OFFLINE
  • Posts: 191
  • Thanks: 24
  • Karma: 1
3 years 3 months ago #325982 by kdave321
CB Comments on a JEvents Event? was created by kdave321
Following this thread I see I can easily add CB Comments to Joomla articles, and it works fine -
www.joomlapolis.com/forum/153-professional-member-support/242117-cb-activity-comments-in-joomla-articles

However, I want the comments only when displaying the Event Detail from JEvents. I verified from the script that parses the Custom Layout of the page that the context is "com_jevents". When I add this to "Content - CB Activity", nothing happens. I also tried forcing content.prepare on "[cbactivity:comments /]" but no go.

I have been able to add Phocagallery to the specific event using a "{phocagallery view=category..." string but not sure how to proceed here.

Somehow, the CB Activity plugin has to keep track of comments for each individual event like it would do for articles. I do have CB integration enabled in JEvents.

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 3 months ago - 3 years 3 months ago #325994 by krileon
Replied by krileon on topic CB Comments on a JEvents Event?
Edit "Content - CB Activity" and under "Comments and Likes" tab add your components context to "Include Context". Now under "Comments" enable comment display. I've no idea what the context is for that extension so I can't help you with that, but this will allow it to output on that context if that context even has a onContentAfterDisplay Joomla event implementation. It however is going to store it as "article.CONTEXT_ID" so you may need to adjust the Asset parameter under the "Comments" tab to something like "content.[article_id]" so it's more generic to any location.

The substitution usage is a lot more complicated and isn't likely to work for your situation at this time, but will be doable in CB Activity 6.0.0 very easily.


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: 3 years 3 months ago by krileon.

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

  • kdave321
  • kdave321
  • OFFLINE
  • Posts: 191
  • Thanks: 24
  • Karma: 1
3 years 3 months ago #326005 by kdave321
Replied by kdave321 on topic CB Comments on a JEvents Event?
Yes, that's what I had in the content plugin.
Sometimes, JEvents will trigger onContentPrepare but not onContentAfterDisplay - so I triggered it myself. :)
Code:
$results = $dispatcher->trigger('onContentAfterDisplay', array('com_jevents', &$item, &$item->params, 0));

It actually does display working comments, but right now it's the same comments on every event.
So I need something like "content.[article_id]" to store comments specific to each event, right?
"ev_id" is the unique id (in the table) of the event but I don't know where to put that. In $item? or in your plugin as "content.[ev_id]"?
In this script ( /components/com_jevents/views/default/helpers/defaultloadedfromtemplate.php ) it is $event->ev_id()

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

  • kdave321
  • kdave321
  • OFFLINE
  • Posts: 191
  • Thanks: 24
  • Karma: 1
3 years 3 months ago #326006 by kdave321
Replied by kdave321 on topic CB Comments on a JEvents Event?
I saw no difference changing the plugin asset, but instead in the script, I did this before the trigger:
Code:
$item->id = $event->ev_id();

, and I'm now getting a different comment thread in every event.

Thanks.
The following user(s) said Thank You: krileon

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

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48541
  • Thanks: 8290
  • Karma: 1445
3 years 3 months ago #326020 by krileon
Replied by krileon on topic CB Comments on a JEvents Event?
Thanks for providing your solution. This will be a lot easier in CB Activity 6.0.0 as I'll have it handle the asset automatically based off context and object id. So it'll probably do something like com_jevents.EVENT_ID for the 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 or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum