Since Joomla has other content managers, showing link to content with default Joomla routing url when someone comments on content is not desirable.
Integrating comments on content is great option, we just need a way to customize url to content that is displayed in stream.
Hi,
Thank you for your idea, but for time being this idea cant be implemented, except you hack and hire the 3rd party developer :)
thank you!
Hi,
The modification wont be easy, because it related with Activities stream library, I suggest you track the controllers/system.php, look on function ajaxStreamAddComment()
I have located most of data that is presented in stream as post on Joomla content but where is url to Joomla content generated is eluding me.
When someone comments on Joomla content in header of that activity on wall there are 2 links and text between:
I'm interested in location where url for content test is generated.user test1 commented on content test
Hi,
Seems we have bug on it, the link is not be generated to JRoute or CRoute, is it?
Please look this file components/com_community/controllers/system.php, and find this code
$wallParams->get('object_url')
It looks like it should be responsible for creation of that url but commenting out whole that part:
//check if there is any links in object name url
$wallParams = new CParameter($wallOptions->params);
$wallLink = '';
if ($wallParams->get('object_url')) {
if ($wallParams->get('object_title')) $wallLink = '<a href="'.$wallParams->get('object_url').'">'.$wallParams->get('object_title').'</a>';
else $wallLink = '<a href="'.$wallParams->get('object_url').'">'.$wallOptions->object_name.'</a>';
} else {
//there is no link here
if ($wallParams->get('object_title')) $wallLink = $wallParams->get('object_title');
else $wallLink = $wallOptions->object_name;
}
I have found that url is located in database table:
*_community_thirdparty_wall_options - as params field -> object_url: {"object_url":"index.php?option=com_content&view=article&id=1&catid=2&Itemid=117","object_title":"test"}
*_community_activities - as title field -> {actor} commented on <a href="index.php?option=com_content&view=article&id=1&catid=2&Itemid=117">test</a>
In *_community_wall there is reference to other db data.
So new question is: Where is that url saved in db so I can change it before it is saved? :) or what is layout file used to modify url before it is displayed?
url to joomla content is processed on line 268 in \layout\stream\base.php. to avoid compatibility issues will do url manipulation on that location.
If someone else uses FlexiContent on Joomla and JomSocial, to get "correct" url in wall posts that display comments on FlexiContent content change:
...\components\com_community\templates\Your_Template\layouts\stream\base.php
before line 265 that looks like:
$title = $act->title;
if (JComponentHelper::getComponent('com_flexicontent', true)->enabled) // Check if FlexiContent is installed and enabled
{
if ((strpos($act->title, 'option=com_content') !== false) && (strpos($act->title, 'view=article') !== false)) { // Check if url is content url to article
$act->title = str_replace ('option=com_content', 'option=com_flexicontent', $act->title) ;
$act->title = str_replace ('view=article', 'view=item', $act->title) ;
$act->title = str_replace ('catid=', 'cid=', $act->title) ;
}
}
Hi,
I think that is the one solution for this hacking...:)
Thank you for your sharing.
cheers!