Jetzt. :-) Hier der richtige Code
Ein Tipp - schaut euch die Contao-Dateien an. Da findet man die unterschiedlichen Palettentypen. In meinem Fall war es tl_news.php
PHP-Code:
<?php
use Contao\CoreBundle\DataContainer\PaletteManipulator;
// 2. Autor
$GLOBALS['TL_DCA']['tl_news']['fields']['newsSecondAuthor'] = [
'label' => &$GLOBALS['TL_LANG']['tl_news']['newsSecondAuthor'],
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'clr w50'),
'sql' => "varchar(255) NOT NULL default ''",
];
// Newsmedium
$GLOBALS['TL_DCA']['tl_news']['fields']['newsMedium'] = [
'label' => &$GLOBALS['TL_LANG']['tl_news']['newsMedium'],
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'clr long'),
'sql' => "varchar(255) NOT NULL default ''",
];
// Newssprache DE
$GLOBALS['TL_DCA']['tl_news']['fields']['newsLanguageDE'] = [
'label' => &$GLOBALS['TL_LANG']['tl_news']['newsLanguageDE'],
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''",
];
// Newssprache EN
$GLOBALS['TL_DCA']['tl_news']['fields']['newsLanguageEN'] = [
'label' => &$GLOBALS['TL_LANG']['tl_news']['newsLanguageEN'],
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''",
];
PaletteManipulator::create()
->addLegend('newsMedium_legend', 'date_legend', PaletteManipulator::POSITION_BEFORE)
->addField('newsMedium', 'newsMedium_legend', PaletteManipulator::POSITION_APPEND)
->addField('newsLanguageDE', 'newsMedium_legend', PaletteManipulator::POSITION_APPEND)
->addField('newsLanguageEN', 'newsMedium_legend', PaletteManipulator::POSITION_APPEND)
->addField('newsSecondAuthor', 'author', PaletteManipulator::POSITION_AFTER)
->applyToPalette('default', 'tl_news')
->applyToPalette('article', 'tl_news')
->applyToPalette('external', 'tl_news')
->applyToPalette('internal', 'tl_news')
;