Skip to Content Skip to Menu

CB Activity, comments and likes for EasyBlog/Articles posts and Activity Stream

  • robster80
  • robster80
  • OFFLINE
  • Posts: 46
  • Thanks: 5
  • Karma: 0
2 months 3 days ago - 2 months 3 days ago #339152 by robster80
Hello,
I have managed to configure comments and likes for articles and it works well. Users can react and comment under the article and continue the discussion on the home page in the recent activity stream. I want to achieve the same for all posts created in EasyBlog as well. So, I don't want an activity to be created as soon as a blog post is created (unless as an option), but I would like it to be created when a user likes or leaves a comment on the post page. The activities should be linked to the posts assigned to them, and it would be great if the activities contained the same information as for articles (title being a link, and the beginning of the content). How could this be achieved?
best regards,
Robert.
Last edit: 2 months 3 days ago by robster80.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48536
  • Thanks: 8290
  • Karma: 1445
2 months 3 days ago #339158 by krileon
It will depend on your level of experience as a developer as it requires coding. The easiest way to log new activity entries is to use CB Auto Actions. The below for example will log a new activity entry when a comment is created.

Global
Triggers: activity_onAfterCommentStreamCreate
Type: CB Activity
User: Automatic
Access: Everybody
Conditions
Field: Custom > Value
Custom Value: [var3_asset]
Operator: Is REGEXP
Value: /^easyblog\.\d+$/
Action
Mode: Activity
Method: Create
Stream: Profile Activity
Asset: [var3_asset]

This assumes your comment stream is rendering in EasyBlog with an asset of "easyblog.POST_ID". This should then for example create a new activity entry when commenting on a stream with that asset.

Now that the activity entry exists it needs to be customized to output custom content like all the core activity entries. This is done from a set of template files to minimize the amount of work. This is where coding comes in. Your starting point will be the example file provided below.

/components/com_comprofiler/plugin/user/plug_cbactivity/templates/default/activity/custom/example.php

In it it describes how to override all aspects of the activity display. Using the above asset you'd need to have the following file.

/components/com_comprofiler/plugin/user/plug_cbactivity/templates/default/activity/custom/easyblog.php

From there you can call EasyBlog API to render your blog post inline or however you like. For examples of how core activity does this take a look at the files in the below folder.

/components/com_comprofiler/plugin/user/plug_cbactivity/templates/default/activity/core

If you need to apply custom access restrictions to that asset then you can use the below template structure to run various functionality like context checks, access checks, custom grouping logic, or source object construction.

/components/com_comprofiler/plugin/user/plug_cbactivity/templates/default/assets

Examples are provided in each of those functions within that folder as "example.php" and are extensively documented directly in their code so should be a reasonable starting point. They are also working examples by simply creating an activity entry with "example.1" asset you'll see them function.

So as you can see it's a bit of work to implement custom activity rendering. I'm planning on trying to implement a UI for this in a future CB Activity release to try and simplify it some more, but there's only so much I can do about rendering content from unknown extensions and data sources.


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.
The following user(s) said Thank You: robster80

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

  • robster80
  • robster80
  • OFFLINE
  • Posts: 46
  • Thanks: 5
  • Karma: 0
2 months 3 days ago #339161 by robster80
This is probably beyond me... but at the same time too important for me not to try. At the moment there are two discourses going on on my site, one in the activity stream with a linked post and the other directly under the post in the EasyBlog comment system. I have no experience with php or joomla development, but some with other programming languages. I hope you will consider making ready-made solutions for the most popular content plugins. That way, we could dispense with other solutions for commenting on those contents. In the meantime, though, I'll try my hand at this uneven battle :)

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48536
  • Thanks: 8290
  • Karma: 1445
2 months 3 days ago #339162 by krileon
If EasyBlog was free then there probably wouldn't be any issue adding support, but I'm not in a position to be spending money to buy other extensions to integrate them. You're the only user that has requested this so that'd effectively be a complete financial loss for us. So while I do sympathize we are still a business that needs to stay afloat. Additionally if developers would like us to add support they need only reach out to us and provide us their latest stable release and we can look into supporting their extension (note this is still subject to time availability on our end).

In a future release I'll be trying to implement a backend UI for setting up custom activity parsing to hopefully make this easier, but you'd still need to know some coding or at the very least access to API documentation for the extension as there isn't really a way for me to just automate display of other unknown extensions content.

If easy blogs fires normal Joomla content events then that'd also simplify things to a degree as the CB Activity Bot is a standard Joomla content plugin for inserting streams, likes, etc.. anywhere content plugins are supported. All their documentation seams locked behind a paywall so I've no clue what to suggest in that regard.


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.

  • robster80
  • robster80
  • OFFLINE
  • Posts: 46
  • Thanks: 5
  • Karma: 0
1 month 4 weeks ago - 1 month 4 weeks ago #339211 by robster80
I've tried but failed :( 
EasyBlog has enabled me to do many things, simplified others, but in my current situation I am faced with a difficult choice. Due to the inferior support of StackIdeas vis-à-vis you, I will abandon EB in favour of Joomla articles. I have analysed the assumptions made a few years ago and I see that today the compromises will be less painful and I will be able to base the content only on articles. I tested the creation of a dedicated blog category and the automatic publication of activity when an entry is added in that category - it works. I have configured comments and likes to be visible on the articles page and in the activity stream - it works.
Problems:
  • When an activity is published with the article content, that entry does not contain embedded videos, for example - if there are other things removed, I'm not aware of it yet. What is visible does not even suggest that there is any content missing there.
  • If the article contains a readmore, in the version displayed by the activity the content breaks off at that point, but the read more link is missing. 
I have also checked both of these issues on a clean installation with only CB installed.

What I would like to achieve is:
  • the activity should display the full content, including the embedded elements and, if that's not possible, embed some alternate images in those places to suggest the need to go to the article page.
  • the activity should display the content for the readmore element and generate a read more link taking user to the article page.
  • as an option: if there is a text limit of e.g. 400 characters in the stream settings, this is how much should be displayed from the article along with the read more link.
A side issue is that I am one of those at whom hashtags do not work (even with the backward compatibility setting), with mentions working. I use flairs as a replacement and they are ok, but I miss the ability to click on them to trigger filtering. I mention this, in this thread, because I would also like such a flair to automatically add to the activity based on the article category name. Perhaps I could add an additional field in the category to bind it to such a flair and use auto action?

I hope that this change in approach will make it easier for you to help me achieve my goals.
best regards,
Robert.
Last edit: 1 month 4 weeks ago by robster80.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48536
  • Thanks: 8290
  • Karma: 1445
1 month 4 weeks ago #339212 by krileon

When an activity is published with the article content, that entry does not contain embedded videos, for example - if there are other things removed, I'm not aware of it yet. What is visible does not even suggest that there is any content missing there.

The article preview at this time strips all media. I'll be reviewing in a future release how to better let Joomla entirely handle the rendering using page break behavior. This however is just a template file so it is possible to completely override this and change it however you like.

the activity should display the content for the readmore element and generate a read more link taking user to the article page.

That's planned for a future release, but it might be more doable now. I was quite limited by Joomla 3 and older releases so will take a look at Joomla 4/5 APIs and see if it's more feasible to implement this.

as an option: if there is a text limit of e.g. 400 characters in the stream settings, this is how much should be displayed from the article along with the read more link.

CB Activity has automatic read more handling so long posts don't span the page too much so nothing specific to articles needs implemented for that.

A side issue is that I am one of those at whom hashtags do not work (even with the backward compatibility setting), with mentions working. I use flairs as a replacement and they are ok, but I miss the ability to click on them to trigger filtering. I mention this, in this thread, because I would also like such a flair to automatically add to the activity based on the article category name. Perhaps I could add an additional field in the category to bind it to such a flair and use auto action?

Please open a separate topic regarding your hashtag issue and detail in what ways they're not working for you.


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