TYPO3 - ext_tables.php 检查中的 TCA 和 TCA/Overrides v8
TYPO3 - TCA in ext_tables.php check and TCA/Overrides for v8
为 TYPO3 8LTS 更新了 ext_tables.php、TCA 和 TCA/Overrides?我将 TCA 定义从 ext_tables.php 移动到 /TCA 文件夹,列表视图中的查询再次运行:
ext_tables.php
<?php
if (!defined('TYPO3_MODE')) {die('Access denied.');}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'Code',
'Description'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_code_domain_model_code', 'EXT:code/Resources/Private/Language/locallang_csh_tx_code_domain_model_code.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_code_domain_model_code');
Configuration/TCA/tx_code_domain_model_code.php
... // TCA defintions
配置/TCA/Overrides/tt_content.php
<?php
if (!defined('TYPO3_MODE')) {die('Access denied.');}
$_EXTKEY = 'code';
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'Code',
'Description'
);
$extensionName = strtolower(\TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY));
$pluginName = strtolower('Code');
$pluginSignature = $extensionName.'_'.$pluginName;
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:'.$_EXTKEY . '/Configuration/FlexForms/flexform_code.xml');
配置/TCA/Overrides/tt_content.php
<?php
if (!defined('TYPO3_MODE')) {die('Access denied.');}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('code', 'Configuration/TypoScript', 'Description');
不兼容。
您应该在以下位置对 tx_code_domain_model_code 进行 TCA 定义:
Configuration/TCA/tx_code_domain_model_code.php
静态模板定义在:
Configuration/TCA/Overrides/sys_template.php
您的插件和 flexform 定义在:Configuration/TCA/Overrides/tt_content.php
请注意,$_EXTKEY 变量未在这些文件中定义,因此您必须自己键入扩展密钥。
为 TYPO3 8LTS 更新了 ext_tables.php、TCA 和 TCA/Overrides?我将 TCA 定义从 ext_tables.php 移动到 /TCA 文件夹,列表视图中的查询再次运行:
ext_tables.php
<?php
if (!defined('TYPO3_MODE')) {die('Access denied.');}
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'Code',
'Description'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr('tx_code_domain_model_code', 'EXT:code/Resources/Private/Language/locallang_csh_tx_code_domain_model_code.xlf');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::allowTableOnStandardPages('tx_code_domain_model_code');
Configuration/TCA/tx_code_domain_model_code.php
... // TCA defintions
配置/TCA/Overrides/tt_content.php
<?php
if (!defined('TYPO3_MODE')) {die('Access denied.');}
$_EXTKEY = 'code';
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
$_EXTKEY,
'Code',
'Description'
);
$extensionName = strtolower(\TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY));
$pluginName = strtolower('Code');
$pluginSignature = $extensionName.'_'.$pluginName;
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:'.$_EXTKEY . '/Configuration/FlexForms/flexform_code.xml');
配置/TCA/Overrides/tt_content.php
<?php
if (!defined('TYPO3_MODE')) {die('Access denied.');}
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile('code', 'Configuration/TypoScript', 'Description');
不兼容。
您应该在以下位置对 tx_code_domain_model_code 进行 TCA 定义: Configuration/TCA/tx_code_domain_model_code.php
静态模板定义在: Configuration/TCA/Overrides/sys_template.php
您的插件和 flexform 定义在:Configuration/TCA/Overrides/tt_content.php
请注意,$_EXTKEY 变量未在这些文件中定义,因此您必须自己键入扩展密钥。