First Plugin

  • PDF

For your first plugin you will be modifying the Replace Abbreviation plugin.

We we do the following to extend this plugin:

  • Add three parameters to the plugin, by editing the XML file.  These parameters are:
    • Limit for the Replace function (preg_replace)
    • Abbreviation field of type textarea
    • Replacement field of type textarea

For plugins you do not need a params.ini file - plugins automatically save parameters in the jos_plugin table under the 'params' column.

You will then replace the hard coded abbreviation and replacement arrays with the parameter values.  You can use the 'explode' function to create the arrays from the text field.

 // Create an array of text abbreviations
$abbr = explode(",", $this->params->get('abbr_list', 1));

To learn more about regular expressions take a look at these two resources: and

The new version 1.6 plugin is available here - this is a system plugin so you may need to disable the content version of the plugin and enable the system version.

1.6 Version of Replace Abbreviations Plugin