I am having a real problem, which is probably very easy to create and use joomla plugins.
Here is what I have done so far.
I created a sample joomla plugin using the following two files inside a folder and named them the same.
I have listed their contents below.
The plugin is installed correctly through the admin panel
I then enable it through the plugin manager
OK. everything is ready to go.
How to use the plugin in the article after turning on the plugin?
ZIP FOLDER: MakePlugIn FOLDER: MakePlugIn
MakePlugIn.php -
<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.plugin.plugin');
class plgContentMakePlugIn extends JPlugin
{
function plgContentMakePlugIn (&$subject)
{
parent::__construct ($subject);
}
function onPrepareContent (&$article, &$params, $page=0)
{
print "I am a happy plugin";
}
}
?>
MakePlugIn.xml -
<?xml version="1.0" encoding="utf-8"?>
<install version="1.5" type="plugin" group="content">
<name>Make-Plug-In</name>
<author>Make-Plug-In</author>
<creationDate>03/15/2011</creationDate>
<copyright>Copyright (C) 2011 Holder. All rights reserved.</copyright>
<license>GNU General Public License</license>
<authorEmail>authoremail@website.com</authorEmail>
<authorUrl>www.authorwebsite.com</authorUrl>
<version>1.0</version>
<description>Make-Plug-In test</description>
<files>
<filename plugin="MakePlugIn">MakePlugIn.php</filename>
</files>
</install>
source
share