By default, under category option, only could add one image. I want to insert second image. I made a plugin to extend category.xml, but it doesn't work.
Plugin files:
categorydrawing.xml
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" group="content" method="upgrade">
<name>plg_category_drawing_image</name>
<description>To add an drawing image to category</description>
<files>
<filename plugin="categorydrawing">categorydrawing.php</filename>
<folder>params</folder>
</files>
</extension>
categorydrawing.php
<?php
// no direct access
defined ('_JEXEC') or die;
class plgContentExample extends JPlugin
{
/**
* Load the language file on instantiation.
* Note this is only available in Joomla 3.1 and higher.
* If you want to support 3.0 series you must override the constructor
*
* @var boolean
* @since <1.0>
*/
protected $autoloadLanguage = true;
/**
* Prepare form and add my field.
*
* @param JForm $form The form to be altered.
* @param mixed $data The associated data for the form.
*
* @return boolean
*
* @since <1.0>
*/
function onContentPrepareForm($form, $data)
{
$app = JFactory::getApplication();
$option = $app->input->get('option');
switch($option)
{
case 'com_categories' :
if ($app->isClient('administrator'))
{
JForm::addFormPath(__DIR__ . '/forms');
$form->loadFile('category', false);
}
return true;
}
return true;
}
}
?>