我周圍搜索了很多,但我沒有找到任何好的信息 添加自定義字段到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