我正在創建Typo3(版本4.5.22)中的第一個擴展。我使用Dmitry Dulepov的「TYPO3 Extension Development」一書作爲指導(非常有用的參考資料)。我使用Kickstarter來完成事情,它生成的一個東西是一個$ TCA,與我自己的數據庫表一起使用。TYPO3 4.5:TCA是否應該顯示在「插件選項」中?
現在,我的理解是,當您創建一個新的「插入插件」內容項目時,TCA會確定我的插件在「插件選項」下的後端出現的選項。問題是,這部分仍然是空白的。當我選擇我的插件時,沒有顯示選項。
我能夠構建Flexform並讓它顯示在「插件選項」下,但我的插件的一個非常重要的組件是能夠使用「建議」表單來搜索記錄,並從我已經讀過,使用Flexforms無法正常工作。
我是否在ext_tables中缺少一個簡單的函數來讓我的TCA顯示在「插件選項」部分?對不起,如果我完全離開這裏; Typo3的龐大複雜性讓我有點發呆。
這裏是我的ext_tables.php,這是由Kickstarter的產生:
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
t3lib_extMgm::allowTableOnStandardPages('tx_newsbuilder_newsitems');
t3lib_extMgm::addToInsertRecords('tx_newsbuilder_newsitems');
$TCA['tx_newsbuilder_newsitems'] = array(
'ctrl' => array(
'title' => 'LLL:EXT:newsbuilder/locallang_db.xml:tx_newsbuilder_newsitems',
'label' => 'uid',
'tstamp' => 'tstamp',
'crdate' => 'crdate',
'cruser_id' => 'cruser_id',
'default_sortby' => 'ORDER BY crdate',
'delete' => 'deleted',
'enablecolumns' => array(
'disabled' => 'hidden',
),
'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
'iconfile' => t3lib_extMgm::extRelPath($_EXTKEY) . 'icon_tx_newsbuilder_newsitems.gif',
),
);
t3lib_div::loadTCA('tt_content');
$TCA['tt_content']['types']['list']['subtypes_excludelist'][$_EXTKEY.'_pi1'] = 'layout,select_key';
t3lib_extMgm::addPlugin(array(
'LLL:EXT:newsbuilder/locallang_db.xml:tt_content.list_type_pi1',
$_EXTKEY . '_pi1',
t3lib_extMgm::extRelPath($_EXTKEY) . 'ext_icon.gif'
),'list_type');
if (TYPO3_MODE === 'BE') {
$TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']['tx_newsbuilder_pi1_wizicon'] = t3lib_extMgm::extPath($_EXTKEY) . 'pi1/class.tx_newsbuilder_pi1_wizicon.php';
}
// Flexform
//$TCA['tt_content']['types']['list']['subtypes_addlist'] [$_EXTKEY . '_pi1'] = 'pi_flexform';
//t3lib_extMgm::addPiFlexFormValue($_EXTKEY . '_pi1', 'FILE:EXT:' . $_EXTKEY . '/pi1/flexform_ds.xml');
?>
這裏,另外,是我tca.php:
<?php
if (!defined('TYPO3_MODE')) {
die ('Access denied.');
}
$TCA['tx_newsbuilder_newsitems'] = array(
'ctrl' => $TCA['tx_newsbuilder_newsitems']['ctrl'],
'interface' => array(
'showRecordFieldList' => 'hidden,tt_news_uid,singleview_uid,fishback_uid,fishback_url,headline,subheading,link'
),
'feInterface' => $TCA['tx_newsbuilder_newsitems']['feInterface'],
'columns' => array(
'hidden' => array(
'exclude' => 1,
'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.hidden',
'config' => array(
'type' => 'check',
'default' => '0'
)
),
'tt_news_uid' => array(
'exclude' => 0,
'label' => 'LLL:EXT:newsbuilder/locallang_db.xml:tx_newsbuilder_newsitems.tt_news_uid',
'config' => array(
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'NO_TABLE_NAME_AVAILABLE',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
)
),
'singleview_uid' => array(
'exclude' => 0,
'label' => 'LLL:EXT:newsbuilder/locallang_db.xml:tx_newsbuilder_newsitems.singleview_uid',
'config' => array(
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'tt_news',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
)
),
'fishback_uid' => array(
'exclude' => 0,
'label' => 'LLL:EXT:newsbuilder/locallang_db.xml:tx_newsbuilder_newsitems.fishback_uid',
'config' => array(
'type' => 'group',
'internal_type' => 'db',
'allowed' => 'pages',
'size' => 1,
'minitems' => 0,
'maxitems' => 1,
)
),
'fishback_url' => array(
'exclude' => 0,
'label' => 'LLL:EXT:newsbuilder/locallang_db.xml:tx_newsbuilder_newsitems.fishback_url',
'config' => array(
'type' => 'input',
'size' => '15',
'max' => '255',
'checkbox' => '',
'eval' => 'trim',
'wizards' => array(
'_PADDING' => 2,
'link' => array(
'type' => 'popup',
'title' => 'Link',
'icon' => 'link_popup.gif',
'script' => 'browse_links.php?mode=wizard',
'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1'
)
)
)
),
'headline' => array(
'exclude' => 0,
'label' => 'LLL:EXT:newsbuilder/locallang_db.xml:tx_newsbuilder_newsitems.headline',
'config' => array(
'type' => 'text',
'cols' => '48',
'rows' => '1',
)
),
'subheading' => array(
'exclude' => 0,
'label' => 'LLL:EXT:newsbuilder/locallang_db.xml:tx_newsbuilder_newsitems.subheading',
'config' => array(
'type' => 'text',
'cols' => '48',
'rows' => '1',
)
),
'link' => array(
'exclude' => 0,
'label' => 'LLL:EXT:newsbuilder/locallang_db.xml:tx_newsbuilder_newsitems.link',
'config' => array(
'type' => 'input',
'size' => '15',
'max' => '255',
'checkbox' => '',
'eval' => 'trim',
'wizards' => array(
'_PADDING' => 2,
'link' => array(
'type' => 'popup',
'title' => 'Link',
'icon' => 'link_popup.gif',
'script' => 'browse_links.php?mode=wizard',
'JSopenParams' => 'height=300,width=500,status=0,menubar=0,scrollbars=1'
)
)
)
),
),
'types' => array(
'0' => array('showitem' => 'hidden;;1;;1-1-1, tt_news_uid, singleview_uid, fishback_uid, fishback_url, headline, subheading, link')
),
'palettes' => array(
'1' => array('showitem' => '')
)
);
?>
看起來我對Flexforms中的「建議」嚮導不適用,所以我現在就採取這種方式。但是,TCA不應該出現嗎? – Nick 2013-03-27 20:44:03