我周围搜索了很多,但我没有找到任何好的信息 添加自定义字段到Joomla文章(com_content & view = edit)。只是你如何破解Joomla的核心文件来添加自己的领域,但它不是我的替代方案。Joomla文章编辑,customfield
我认为最好的方法就是创建一个自己的插件,但我会卡在这里。我已经创建了一个插件到组“系统”,但我的插件不会被触发。
有谁知道我该如何解决这个好方法?
我的插件customfield.php:
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport('joomla.plugin.plugin');
class plgSystemCustomField extends JPlugin {
function onContentPrepareForm($form, $data)
{
echo "Trigger 1???";
if($form->getName() == 'com_content.article') {
JForm::addFormPath(dirname(__FILE__).'/form');
$form->loadFile('customfield', false);
print_r($form);
}
return true;
}
function onDisplay() {
echo "Trigger 2???";
}
}
我解决了这个问题。 – Rond 2012-01-12 20:05:05