I would like to use CB Auto Actions together with CB Activity to show not only the article title when a new Joomla article is created, but also the values of the article’s custom fields.
For example, when a new article is published, the activity stream should display the article title plus selected Joomla custom field values.
Best way to do that is override the template file and add whatever details you want for articles. To do this within your hosting panel navigate to the below directory.
/components/com_comprofiler/plugin/user/plug_cbactivity/templates
Now create a new folder. For the purpose of this example lets call that folder "custom". This should give you the below structure.
/components/com_comprofiler/plugin/user/plug_cbactivity/templates/custom
Now we need to create the directories for overriding that template file. Create the necessary directories until you've the following structure.
/components/com_comprofiler/plugin/user/plug_cbactivity/templates/custom/activity/core
Next navigate to that same directory structure in the default template. So this should bring you to the below.
/components/com_comprofiler/plugin/user/plug_cbactivity/templates/default/activity/core
Finally copy "article.php" to your custom template structure, which should give you the following.
/components/com_comprofiler/plugin/user/plug_cbactivity/templates/custom/activity/core/article.php
You've successfully created your own template that exclusively overrides article activity display. Now within CB Activity > Parameters > General set "Template" to "custom". Your template will now be applied to all of CB Activity.
You can then freely edit "article.php" and add whatever you like. You'll need to utilize Joomla APIs to pull in the custom fields and render them however you like.
I already set up an Auto Action with trigger onContentAfterSave and context = com_content.article, so the activity entry is created.
This isn't necessary. CB Activity has built in activity logging for this. You can enable it in CB Activity > Parameters > Activity.