ここで説明されているように、joomla のフロントエンドの新しい記事に新しいフィールドを追加しようとしています: http://docs.joomla.org/Adding_custom_fields_to_the_article_component
ただし、フィールドはフォームに表示されません。誰か私に理由を説明できますか?
以下はプラグインファイルに書かれた私のコードです:
function onContentPrepareForm($form, $data)
{
if (!($form instanceof JForm))
{
$this->_subject->setError('JERROR_NOT_A_FORM');
return false;
}
// Add the extra fields to the form.
// need a seperate directory for the installer not to consider the XML a package when "discovering"
JForm::addFormPath(dirname(__FILE__) . '/rating');
$form->loadFile('rating', false);
return true;
}
私が観察したことの 1 つは、コンポーネント内の com_content フォルダーに固定コードが記述されていることです。これが、フィールドが表示されない理由です。次のファイルを変更しても問題ありませんか: \components\com_content\views\form\tmpl