Hey Ihr,
ich versuche gerade nach dieser Anleitung zwei Felder zu dem Inhaltselement Tabelle hinzuzufügen.
https://docs.contao.org/dev/getting-started/dca/
Contao 4.9.12
ContaoManager
XAMPP
Ich habe im root von Contao folgende Ordnerstruktur:
-contao/
--- config/
--- dca/
----- tl_content.php
--- languages/
----- de/
------- tl_content.php
----- en/
------- tl_content.php
dca/tl_content
Code:
<?php
/* HTML in Überschriften */
$GLOBALS['TL_DCA']['tl_content']['fields']['headline']['eval']['allowHtml'] = true;
// contao/dca/tl_content.php
use Contao\CoreBundle\DataContainer\PaletteManipulator;
//Beschreibung des Feldes
$GLOBALS['TL_DCA']['tl_content']['fields']['rowURLExtendedselect'] = [
'label' => &$GLOBALS['TL_LANG']['tl_content']['rowURLExtendedselect'],
'exclude' => true,
'inputType' => 'select',
'options' => array(
'1' => 'Link Agentur für Arbeit',
'2' => 'Link Jobcenter',
'3' => 'Link Jugendamt',
),
'eval' => array('tl_class'=>'w50', 'includeBlankOption'=>true),
'sql' => "varchar(255) NOT NULL default ''"
];
$GLOBALS['TL_DCA']['tl_content']['fields']['rowURLExtended'] = [
'label' => &$GLOBALS['TL_LANG']['tl_content']['rowURLExtended'],
'exclude' => true,
'search' => true,
'inputType' => 'text',
'eval' => array('rgxp'=>'url', 'decodeEntities'=>true, 'maxlength'=>255, 'fieldType'=>'radio', 'filesOnly'=>true),
'wizard' => array(
array('tl_content', 'pagePicker')
),
'sql' => "varchar(255) NOT NULL default ''"
];
PaletteManipulator::create()
// add a new "custom_legend" before the "date_legend"
->addLegend('custom_legend_table', 'type_legend', PaletteManipulator::POSITION_AFTER)
// directly add new fields
->addField('rowURLExtendedselect', 'custom_legend_table', PaletteManipulator::POSITION_APPEND)
->addField('rowURLExtended', 'custom_legend_table', PaletteManipulator::POSITION_APPEND)
// then apply it to the palette as usual
->applyToPalette('default', 'tl_content')
;
languages/de/tl_content
Code:
<?php
$GLOBALS['TL_LANG']['tl_content']['rowURLExtendedselect'][0] = 'Link zum jeweiligen Formular';
$GLOBALS['TL_LANG']['tl_content']['rowURLExtendedselect'][1] = 'Hier den Link auswählen.';
$GLOBALS['TL_LANG']['tl_content']['rowURLExtended'][0] = 'Link zur jeweiligen Seite angeben';
$GLOBALS['TL_LANG']['tl_content']['rowURLExtended'][1] = 'Hier den Link eintragen.';
$GLOBALS['TL_LANG']['tl_content']['custom_legend_table'] = 'Links der Zeile';
Kann mir jemand weiterhelfen wieso ich die Felder nicht im Backend in dem Inhaltselement Tabelle angezeigt bekomme?
Die Ordner var/cache/prod habe ich schon einmal gelöscht.
Lesezeichen