Für die Nachwelt, ich hab jetzt tl_news erweitert, einfach in das /contao/dca/ Verzeichnis 'tl_news.php':
Code:
<?php
use Contao\CoreBundle\DataContainer\PaletteManipulator;
PaletteManipulator::create()
// add a new "custom_legend" after the "title_legend"
->addLegend('custom_legend', 'title_legend', PaletteManipulator::POSITION_AFTER)
// directly add new fields to the new legend
->addField('onlyTeaser', 'custom_legend', PaletteManipulator::POSITION_APPEND)
// now the field is registered in the PaletteManipulator
// but it still has to be registered in the globals array:
->applyToPalette('default', 'tl_news')
;
\Contao\DcaLoader::loadDataContainer('tl_news');
$GLOBALS['TL_DCA']['tl_news']['fields']['onlyTeaser'] =
[
'exclude' => true,
'label' => ['Only Teaser', 'Only Teaser'],
'inputType' => 'checkbox',
'eval' =>
[
'tl_class' => 'w50',
'includeBlankOption' => true
],
'sql' => [
'type' => 'boolean',
'default' => false,
],
];
und dann im Template die Abfrage:
Code:
<?php if($this->linkHeadline && $this->link && $this->onlyTeaser == false): ?>
Lesezeichen