Ich versuche, die TCA (Frame_Class) zu erweitern und jedes Mal, wenn ich einen meiner Elemente ausgewählt habe > Das habe ich < /p>
1- Erstellen Sie eine neue Datei tt_content an diesen Pfadverlängerungen \ Site \ configuration \ tca \ overrides \ tt_content.php < /p>
2- Stellen Sie einen Code ein < /p>
// 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
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::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'
],
]);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tt_content', 'custom_section', '', 'after:frame_class');
// Add the new field custom_class to tt_content
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::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
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('tt_content', 'custom_class', '', 'after:frame_class');
< /code>
3- Fügen Sie die neuen Felder der ext_table hinzu.CREATE TABLE tt_content (
custom_class varchar(255) DEFAULT '' NOT NULL,
custom_section varchar(255) DEFAULT '' NOT NULL
);
< /code>
4- Datenbankstruktur analysieren und den Cache löschen < /p>
Dies funktioniert gut für alle CTypes, nur die CType vom Typ Flux. irgendwelche Hilfe?
TYPO3 Erweiterung TCA funktioniert nicht an Inhaltselementen des Typs Fluss ⇐ Php
-
- Similar Topics
- Replies
- Views
- Last post
-
-
TYPO3 13 Frische Fenster Installation schlägt die Bildverarbeitungstests aus
by Anonymous » » in Php - 0 Replies
- 10 Views
-
Last post by Anonymous
-