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


Get a VIP membership
11 years 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...

152 Posts
pixelpixel
11 years 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

11 years ago
1
Level 2

Hi pixelneco,

you're welcome :-)

I marked it as solved.

152 Posts
pixelpixel
11 years ago
0
Level 3

thank you :)

9 years ago
1
Level 1

Today I faced another situation were a content plugin has not been triggered on a simple article content type.

My solution this time:

In my template override for articles, /mytemplate/html/com_content/article/default.php I looked for the line that echos the content:

	echo $this->item->text;

and replaced it with:

	echo JHTML::_('content.prepare', $this->item->text);

Now the plugin gets triggered.

Don't know what is the reason for why some content plugins do not get triggered with Seblod. Any insight on this would be much appreciated.

PS: Haven't been writing here for quite some time. The editor still feels clumsy.

251 Posts
Viktor Iwan
9 years ago
0
Level 2

Have you take a look on plugin ordering ? also, in seblod, i think there are 2 'rendering' process... one is on content plugin and the second is on system plugin.

Get a VIP membership