I'm new to Joomla. The first time I create a plugin. I am trying to create a new plugin, but it does not work. Events did not react.

Joomla version 3.4.8. PHP 5.6

My Code


    defined( '_JEXEC' ) or die;
echo 'test'; // WORKING!
class plgContentTitlere extends JPlugin
    protected $autoloadLanguage = true;

    function __construct( &$subject , $config ) {
    parent::__construct($subject, $config);
         echo 'TEST'; // DOESN"T WORK!
     public function onContentPrepare($context,&$row, &$params, $limitstart) {
          echo 'TEST'; // DOESN"T WORK!

File plgcontenttitlere.xml

<?xml version="1.0" encoding="utf-8"?>
<extension version="3.1" type="plugin" group="content" method="upgrade">
    <name>Content - TitleRe</name>
    <creationDate>March 2016</creationDate>
    <copyright>Copyright (C) 2016 - Vektor Media. All rights reserved.</copyright>
    <license>GNU General Public License version 2 or later; see LICENSE.txt</license>
        <filename plugin="plgcontenttitlere">plgcontenttitlere.php</filename>

As you can see the output before plugin echo 'test' the work. But inside it does not work. error_reporting does not display an error

2 Answers 2


The naming convention of the plugin files must be proper. This might be the issue why your plugin class is not rendering. See the example below:

Plugin File: nameofplugin.php

class plgContentNameofplugin extends JPlugin {
 //plugin code

XML File: nameofplugin.xml

   <filename plugin="nameofplugin">nameofplugin.php</filename>

Please refer the following link for more details:


See the modifications below you would need to do:

  • Rename the 2 files as : titlere.php and titlere.xml
  • In titlere.xml, modify the following:

    <files> <filename plugin="titlere">titlere.php</filename> <filename>index.html</filename> </files>

  • zip the files install it and check, or modify the installed files and check.

Reason: you are naming as plgcontenttitlere which is wrong because plg denotes plugin type, content denotes the content type and titlere is the name of your plugin and therefore, files must be named this way.

  • I tried, but doesn't work Commented Apr 8, 2016 at 7:54
  • @JawlonRodriguez I have modifed the answer for you now after seeing your manifest file, please try as above again
    – Liz.
    Commented Apr 8, 2016 at 12:58
  • YES, Thank you @Ruchika ever so much! respect :) Commented Apr 8, 2016 at 13:12
  • it is our pleasure to be helpful :)
    – Liz.
    Commented Apr 8, 2016 at 13:21

I'm not an expert, but I'll try to point out a couple of things.

1) Looking at your code, the problem (I'm pretty sure) is that echo doesn't go somewhere. If onContentBeforeDisplay is anything like onContentPrepare, then your code should be something like:


I'm guessing this is really your problem.

2) Without seeing the manifest for the plugin, it's really impossible to say. I've done things like forget a file from the manifest, and then have the thing not work.

  • manifest added. $row->text="test".$row->text; doesn't work Commented Apr 8, 2016 at 8:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.