Flexform в typo3 7.6.2 не работает

Я создал расширение с помощью конструктора расширений в версии typo3 7.6.2. Теперь я хотел бы добавить flexform в расширение «Продукты» для подробной страницы PID. Но я изо всех сил пытался интегрировать flexform, но это не сработало.

Вот мой код -

В ext_tables.php -

  \TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
        'Wxproducts.' . $_EXTKEY,
        'Wxproducts',
        'Products'
    );

// flexform integration 
$pluginSignature = str_replace('_','','Wxproducts'.$_EXTKEY) . '_products';
$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
t3lib_extMgm::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_products.xml');

В Конфигурации/FlexForms/flexform_products.php -

<T3DataStructure>
 <sheets>
  <sDEF>
   <ROOT>
     <TCEforms>
      <sheetTitle>Function</sheetTitle>
     </TCEforms>
     <type>array</type>
     <el>
      <switchableControllerActions>
       <TCEforms>
         <label>Select function</label>
         <config>
          <type>select</type>
          <items>

            <numIndex index="0">
             <numIndex index="0">List</numIndex>
             <numIndex index="1">Products->list</numIndex>
            </numIndex>

            <numIndex index="1">
             <numIndex index="0">Detail</numIndex>
             <numIndex index="1">Products->show</numIndex>
            </numIndex>

           </items>
         </config>
       </TCEforms>
      </switchableControllerActions>
     </el>
   </ROOT>
  </sDEF>
 </sheets>
</T3DataStructure>

Это не работает. Я не могу понять, в чем проблема. Есть идеи!

Заранее спасибо!


person vids1229    schedule 23.02.2016    source источник
comment
я думаю, это поможет вам: собственное расширение"> stackoverflow.com/questions/28219192/   -  person Vishal Tanna    schedule 27.02.2016


Ответы (3)


Ваша переменная $pluginSignature кажется неправильной, в ней указано имя поставщика. Попробуйте следующий код:

$extensionName = strtolower(\TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY));
$pluginSignature = $extensionName.'_products';    

Вот пример из книги TYPO3 Extbase:

$pluginSignature = 'simpleblog_bloglisting';

simpleblog — ключ расширения, а bloglisting — имя подключаемого модуля.

person José Ricardo Júnior    schedule 24.02.2016

В файле ext_tables.php в строке:

t3lib_extMgm::addPiFlexFormValue

попробуйте использовать это:

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue
person Robert G.    schedule 24.02.2016

Возможно, вы ошиблись в pluginSignature, попробуйте приведенный ниже код, который может вам помочь.

Работа с v7.6.3

- ext_tables.php

/*** FlexForm ***/
$extensionName = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY);
$pluginSignature = strtolower($extensionName) . '_products'; 

$TCA['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:'.$_EXTKEY.'/Configuration/FlexForms/FlexForm.xml');
/*** FlexForm ***/

-FlexForm.xml

<T3DataStructure>
<meta>
    <langDisable>1</langDisable>
</meta>
<sheets>
    <sDEF>
        <ROOT>
            <TCEforms>
                <sheetTitle>Settings</sheetTitle>
            </TCEforms>
            <type>array</type>
            <el>
                <!-- View -->
                <switchableControllerActions>
                    <TCEforms>
                    <label>Select Options</label>
                    <onChange>reload</onChange>
                    <config>
                        <type>select</type>
                        <items>
                            <numIndex index="0">
                                <numIndex index="0">...Select Item...</numIndex>                            
                            </numIndex> 
                            <numIndex index="1">
                                <numIndex index="0">Action 1</numIndex>
                                <numIndex index="1">ControllerName->action1;ControllerName->action2</numIndex> <!-- Allow action to FE -->
                            </numIndex>
                            <numIndex index="2">
                                <numIndex index="0">Action 2</numIndex>
                                <numIndex index="1">ControllerName->action3;ControllerName->action4</numIndex> <!-- Allow action to FE -->
                            </numIndex>
                        </items>
                    </config>
                    </TCEforms>
                </switchableControllerActions>

                <settings.formID>
                    <TCEforms>
                        <label>Available Forms</label>
                        <displayCond>FIELD:switchableControllerActions:=:ControllerName->action1;ControllerName->action2</displayCond>
                        <config>
                            <type>select</type>
                            <size>1</size>
                            <minitems>0</minitems>
                            <maxitems>1</maxitems>
                            <itemsProcFunc>TYPO3\VendorName\Controller\ControllerName->flexFormsListItems</itemsProcFunc>
                            <items type="array"></items>
                        </config>
                    </TCEforms>
                </settings.formID>
            </el>
        </ROOT>
    </sDEF>
</sheets>
</T3DataStructure>
person Ghanshyam Gohel    schedule 27.02.2016