Hello,
I'm using Seblod latest version in a J!3.1.1 install.
I need to use a comment extension for my project and tried 2 different extensions so far (slicomments and ccomment).
The problem is, that the comment plugin doesn't work on SEBLOD content items.
In the intro view of articles that do not use a SEBLOD template, the comment plugin is working.
But in the content view, that uses a SEBLOD template, the comment plugin is not triggered.
Here is the relevant code of the comment plugin:
jimport('joomla.plugin.plugin');
/**
* plgContentJoscomment
*/
class plgContentJoscomment extends JPlugin
{
private static $control = null;
public function onContentPrepare($context, &$row, &$params)
{
// Don't run this plugin when the content is being indexed
if ($context == 'com_finder.indexer')
{
return true;
}
// simple performance check to determine whether bot should process further
if (strpos($row->text, 'ccomment') === false)
{
return true;
}
$regex = '/{ccomment\s+(.*?)}/i';
preg_match_all($regex, $row->text, $matches, PREG_SET_ORDER);
if (count($matches))
{
self::$control = $matches[0];
$replace = '';
if ($this->findOutComponent($context) == 'com_content' && $this->params->get('on_content_prepare', 0)
&& $context == 'com_content.article'
)
{
$replace = $this->funkyStuff($row, $params, 'com_content');
}
$row->text = str_replace($matches[0][0], $replace, $row->text);
}
return true;
}
}
In the article fulltext I imserted {ccomment on} to display the comments. But they do not get displayed.
Then I tried following code in my template position override to trigger the plugin. But that didn't work either.
JHTML::_('content.prepare', $cck->getValue('art_fulltext'));