im trying to extend the tca (frame_class) and add new items to the select list every time i user chose one of my items an input element of type text should appear so what using the regular steps
this is what i did
1- create an new file tt_content at this path extensionssiteConfigurationTCAOverridestt_content.php
2- put some code into it
// debug($GLOBALS['TCA']['tt_content']['types']);die();
$GLOBALS['TCA']['tt_content']['columns']['frame_class'] = [
'exclude' => true,
'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:frame_class',
'onChange'=>'reload',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
['label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:frame_class.default', 'value' => 'default'],
['label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:frame_class.ruler_before', 'value' => 'ruler-before'],
['label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:frame_class.ruler_after', 'value' => 'ruler-after'],
['label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:frame_class.indent', 'value' => 'indent'],
['label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:frame_class.indent_left', 'value' => 'indent-left'],
['label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:frame_class.indent_right', 'value' => 'indent-right'],
['label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:frame_class.none', 'value' => 'none'],
['label'=>'Custom Section Class','value'=>'Section'],
['label'=>'Custom Class','value'=>'Class']
],
'default' => 'default',
],
];
// Add the new field custom_section to tt_content
TYPO3CMSCoreUtilityExtensionManagementUtility::addTCAcolumns('tt_content', [
'custom_section' => [
'exclude' => true,
'label' => 'Custom Section Class Name',
'description' => 'Section class name',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim',
'behaviour' => [
'allowLanguageSynchronization' => true,
],
],
'displayCond' => 'FIELD:frame_class:=:Section', // Show only if frame_class is 'Section'
],
]);
TYPO3CMSCoreUtilityExtensionManagementUtility::addToAllTCAtypes('tt_content', 'custom_section', '', 'after:frame_class');
// Add the new field custom_class to tt_content
TYPO3CMSCoreUtilityExtensionManagementUtility::addTCAcolumns('tt_content', [
'custom_class' => [
'exclude' => true,
'label' => 'Class Name',
'description' => 'class name',
'config' => [
'type' => 'input',
'size' => 30,
'eval' => 'trim',
'behaviour' => [
'allowLanguageSynchronization' => true,
],
],
'displayCond' => 'FIELD:frame_class:=:Class', // Show only if frame_class is 'Class'
],
]);
// Add the new field to the palettes and show items
TYPO3CMSCoreUtilityExtensionManagementUtility::addToAllTCAtypes('tt_content', 'custom_class', '', 'after:frame_class');
3- add the new fields to the ext_table.sql
CREATE TABLE tt_content (
custom_class varchar(255) DEFAULT '' NOT NULL,
custom_section varchar(255) DEFAULT '' NOT NULL
);
4- Analyze Database Structure and clear the cache
this work fine for all Ctypes only the Ctypes of type flux. any help ?