OK - soweit mal klar.
Hier mal meine aktuellen Daten
PHP-Code:
<?php
// contao/dca/tl_news.php
use Contao\CoreBundle\DataContainer\PaletteManipulator;
$GLOBALS['TL_DCA']['tl_news']['fields']['carpetSource'] = [
'label' => ['Herkunftsland','Geben Sie das Herkunftsland ein'],
'inputType' => 'text',
'eval' => ['tl_class' => 'clr w50', 'maxlength' => 255],
'sql' => ['type' => 'string', 'length' => 255, 'default' => ''],
];
$GLOBALS['TL_DCA']['tl_news']['fields']['carpetProvince'] = [
'label' => ['Provinz','Geben Sie die Provinz ein'],
'inputType' => 'text',
'eval' => ['tl_class' => 'clr w50', 'maxlength' => 255],
'sql' => ['type' => 'string', 'length' => 255, 'default' => ''],
];
$GLOBALS['TL_DCA']['tl_news']['fields']['carpetSize'] = [
'label' => ['Grösse','Geben Sie die Grösse ein'],
'inputType' => 'text',
'eval' => ['tl_class' => 'clr w50', 'maxlength' => 255],
'sql' => ['type' => 'string', 'length' => 255, 'default' => ''],
];
$GLOBALS['TL_DCA']['tl_news']['fields']['carpetPrice'] = [
'label' => ['Preis','Geben Sie den Preis ein'],
'inputType' => 'text',
'eval' => ['tl_class' => 'clr w50', 'maxlength' => 255],
'sql' => ['type' => 'string', 'length' => 255, 'default' => ''],
];
PaletteManipulator::create()
->addLegend('carpet_legend', PaletteManipulator::POSITION_PREPEND)
->addField('carpetSource', 'carpet_legend', PaletteManipulator::POSITION_APPEND)
->addField('carpetProvince', 'carpet_legend', PaletteManipulator::POSITION_APPEND)
->addField('carpetSize', 'carpet_legend', PaletteManipulator::POSITION_APPEND)
->addField('carpetPrice', 'carpet_legend', PaletteManipulator::POSITION_APPEND)
->applyToPalette('default', 'tl_news')
;
Aber: jetzt wird die Sektion ganz unten angeordnet - egal was ich nach 'PaletteManipulator::POSITION_' eingeben - es bleibt unterhalb der Sektion 'Veröffentlichung'.
Wunsch wäre ja, gleich unterhalb 'Titel und Autor'.
Wie bekomme ich die korrekte Position hin?
ach ja, für Mitleser, hier noch die Übersetzung für die Sektion 'carpet_legend'
PHP-Code:
<?php
// contao/languages/de/tl_news.php
$GLOBALS['TL_LANG']['tl_news']['carpet_legend'] = 'Teppichdaten';
Lesezeichen