319 Posts
gebeer
10 months ago
Topic

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'));


319 Posts
gebeer
10 months ago
0
Level 1

I found the solution.


First in the Joomla plugin manager, the plugin "Content - Seblod" must be before other plugins.


Second, I had to activate Mootools for my template because the comment extension relies on it :-(.


Too bad, I thought I could eliminate Mootools from my template once and for all...

97 Posts
pixelneco
10 months ago
2
Level 1

Hi gebeer,

thanks a lot for sharing your solution here. Appreciated! Could you please change the topic to [SOLVED]....? This makes easier to use the forum as some kind of documentation :)


Kind regards

pixelneco

319 Posts
gebeer
10 months ago
1
Level 2

Hi pixelneco,

you're welcome :-)

I marked it as solved.

97 Posts
pixelneco
10 months ago
0
Level 3

thank you :)