2017-07-25 41 views
1

我試圖使我可以配置我自己的擴展的FE插件。我嘗試過的flexform配置沒有顯示在後端。 爲什麼它不起作用,我需要改變什麼?我的彈性配置不顯示

我正在使用Typo3 8.7.3。

下面是相關的代碼部分:

ext_tables.php

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    'Fmogge.'.$extKey, 
    'Nextcourse', 
    'Nächste Kurse' 
); 

$extensionName = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY); 
$frontendpluginName = 'Nextcourse'; 
$pluginSignature = strtolower($extensionName).'_'.strtolower($frontendpluginName); 
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; 
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:'.$_EXTKEY.'/Configuration/FlexForms/Nextcourse.xml'); 

配置/ FlexForms/Nextcourse.xml

<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 
<T3DataStructure> 
    <sheets> 
     <sDEF> 
      <ROOT> 
       <TCEforms> 
        <sheetTitle>Optionen</sheetTitle> 
       </TCEforms> 
       <type>array</type> 
       <el> 
        <settings.ort> 
        <TCEforms> 
         <label>Ort wählen</label> 
         <config> 
          <type>select</type> 
          <items type="array"> 
           <numIndex index="0" type="array"> 
            <numIndex index="0"></numIndex> 
            <numIndex index="1"></numIndex> 
           </numIndex> 
          </items> 
          <foreign_table>tx_coursemanager_domain_model_ort</foreign_table> 
           <foreign_table_where> 
           AND elterndatensatz = 0 
           </foreign_table_where> 
         </config> 
        </TCEforms> 
       </settings.ort> 
      </el> 
     </ROOT> 
    </sDEF> 
</sheets> 

回答

0

可以使用GLOBAL變量,如下面。這對我有用。

只需更換下面一行放在ext_tables.php文件

$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; 
0

$ extKey的$ _EXTKEY您ext_tables.php變化的語法,這將解決您的問題,如:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    'Fmogge.'.$_EXTKEY, 
    'Nextcourse', 
    'Nächste Kurse' 
); 

$extensionName = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY); 
$frontendpluginName = 'Nextcourse'; 
$pluginSignature = strtolower($extensionName).'_'.strtolower($frontendpluginName); 
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; 
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:'.$_EXTKEY.'/Configuration/FlexForms/Nextcourse.xml'); 

提示:避免在未來,使用延長密鑰字符串,而不是使用$ _EXTKEY。它在覈心和各種第三方擴展中已被更改。當你將這樣的配置移動到文件夾Configuration/TCA/..(其中$ _EXTKEY不可用)時,它會有所幫助。

你的柔性成型的文件缺失結束標記爲T3DataStructure像:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?> 
<T3DataStructure> 
    <sheets> 
     <sDEF> 
      <ROOT> 
       <TCEforms> 
        <sheetTitle>Optionen</sheetTitle> 
       </TCEforms> 
       <type>array</type> 
       <el> 
        <settings.ort> 
         <TCEforms> 
          <label>Ort wählen</label> 
          <config> 
           <type>select</type> 
           <items type="array"> 
            <numIndex index="0" type="array"> 
             <numIndex index="0"></numIndex> 
             <numIndex index="1"></numIndex> 
            </numIndex> 
           </items> 
           <foreign_table>tx_coursemanager_domain_model_ort</foreign_table> 
            <foreign_table_where> 
            AND elterndatensatz = 0 
            </foreign_table_where> 
          </config> 
         </TCEforms> 
        </settings.ort> 
       </el> 
      </ROOT> 
     </sDEF> 
    </sheets> 
<T3DataStructure> 
+0

,它應該是$ GLOBALS的[ 'TCA']代替$ TCA –

+0

$ GLOBALS [ 'TCA']的伎倆!你拯救了我的一天。如果您將其作爲答案發布,我會將其標記爲解決方案。 –

+0

$ TCA [TABLENAME]的使用已過時,但仍可在TYPO3 CMS 8中使用 – jokumer