PHP-Code:
<?php
// Definitionen der tl_content anfordern, damit wir sie hier nutzen koennen
Controller::loadDataContainer('tl_content');
// Anpassung der Palette - Neue FELDER hier einfuegen!
$GLOBALS['TL_DCA']['tl_article']['palettes']['default'] = str_replace
(
'teaserCssID',
'teaserTitle,teaserUrl,teaserTarget,teaserSingleSRC,teaserAlt,teaserImageTitle,teaserSize,teaserCssID',
$GLOBALS['TL_DCA']['tl_article']['palettes']['default']
);
// Hinzufügen der neuen Feld-Konfiguration
$GLOBALS['TL_DCA']['tl_article']['fields']['teaserTitle'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_article']['teaserTitle'],
'exclude' => true,
'search' => true,
'inputType' => 'inputUnit',
'options' => array('h2', 'h3', 'h4', 'h5', 'h6'),
'eval' => array('maxlength'=>200, 'tl_class'=>'long'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_article']['fields']['teaserUrl'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_article']['teaserUrl'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('mandatory'=>false, 'rgxp'=>'url', 'decodeEntities'=>true, 'maxlength'=>255, 'tl_class'=>'w50 wizard'),
'wizard' => array(array('tl_content', 'pagePicker')),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_article']['fields']['teaserTarget'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_article']['teaserTarget'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50 m12'),
'sql' => "char(1) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_article']['fields']['teaserSingleSRC'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_article']['teaserSingleSRC'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => array('filesOnly'=>true, 'fieldType'=>'radio', 'mandatory'=>false, 'tl_class'=>'clr'),
'extensions' => \Contao\Config::get('validImageTypes'),
'sql' => "binary(16) NULL"
);
$GLOBALS['TL_DCA']['tl_article']['fields']['teaserAlt'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_article']['teaserAlt'],
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_article']['fields']['teaserImageTitle'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_article']['teaserImageTitle'],
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('maxlength'=>255, 'tl_class'=>'w50'),
'sql' => "varchar(255) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_article']['fields']['teaserSize'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_article']['teaserSize'],
'exclude' => true,
'inputType' => 'imageSize',
'reference' => &$GLOBALS['TL_LANG']['MSC'],
'eval' => array('rgxp'=>'natural', 'includeBlankOption'=>true, 'nospace'=>true, 'helpwizard'=>true, 'tl_class'=>'w50'),
'options_callback' => function ()
{
return System::getContainer()->get('contao.image.image_sizes')->getOptionsForUser(BackendUser::getInstance());
},
'sql' => "varchar(64) NOT NULL default ''"
);
## NICHT VERGESSEN: NEUE FELDER GANZ OBEN IN PALETTE EINFUEGEN!
Außerdem habe ich diee entsprechenden Beschriftungen in /app/Resources/contao/languages/de/ hinterlegt und die Datenbank über die Contao Install aktualisiert.
Lesezeichen