TYPO3 - adding flexform to my own extension

I create my own extension. I found this page about adding Flexform to the extension https://gist.github.com/alrnz/c0f00b196d378f5b9150

And in my ext_tables.php I have this:

\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
    $_EXTKEY,
    'Xlsxtotables',
    'XLSX to tables'
);

// Include flex forms
$pluginSignature = str_replace('_', '', $_EXTKEY) . '_' .    'xlsxtotables'; // from registerPlugin(...)
$TCA['tt_content']['types']['list']['subtypes_addlist']   [$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
    $pluginSignature,    
    'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/flexform_xlsxtotables.xml'
); 

I know that the XML file is in the right place, but I do not get any links from it in the TYPO3 backend.

Any suggestions?

+1
source share
2 answers

Try replacing

$pluginSignature = str_replace('_', '', $_EXTKEY) . '_' .    'xlsxtotables';

by

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

And don't forget to clear your shared cache before you see the change using a flexible form.

+1
source

You can try to execute the code below in the ext_tables.php file

$pluginName = 'Pi1'; // Give Your Plugin Nmae
$pluginSignature = preg_replace('/[^a-z0-9]/', '', strtolower($_EXTKEY)) . '_' . strtolower($pluginName);

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

Flexforms ext_tables.php

$extensionName = \TYPO3\CMS\Core\Utility\GeneralUtility::underscoredToUpperCamelCase($_EXTKEY);
$frontendpluginName = 'xxx'; //Your Front-end Plugin Name
$pluginSignature = strtolower($extensionName) . '_'.strtolower($frontendpluginName);
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform';
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue($pluginSignature, 'FILE:EXT:' . $_EXTKEY . '/Configuration/FlexForms/xyz.xml');
+1

Source: https://habr.com/ru/post/1630009/


All Articles