TYPO3 - ext_tables.php中的TCA检查和v8的TCA /覆盖

时间:2017-08-23 16:36:13

标签: typo3 typo3-extensions typo3-8.x

更新了TYPO3 8LTS的ext_tables.php,TCA和TCA / Overrides?我将TCA定义从ext_tables.php移动到/ TCA文件夹,列表视图中的查询再次起作用:

ext_tables.php

"apps": [
    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico",
        "web.config"
      ],
      ...
    }
  ],   

配置/ TCA / tx_code_domain_model_code.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 / Overrides / tt_content.php

... // TCA defintions

Configuration / 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'); 

1 个答案:

答案 0 :(得分:2)

它不兼容。

您应该在以下位置执行tx_code_domain_model_code的TCA定义: 配置/ TCA / tx_code_domain_model_code.php

静态模板定义: 配置/ TCA /重写/ sys_template.php

你的插件和flexform定义在:Configuration / TCA / Overrides / tt_content.php

请注意,$ _EXTKEY变量未在这些文件中定义,因此您必须自己键入扩展密钥。