Skip to content

Commit ccd785b

Browse files
committed
Synchronize tl_content palette with Contao 5.6
1 parent 543de1b commit ccd785b

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/CustomElements.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Contao\BackendUser;
1313
use Contao\Config;
1414
use Contao\Controller;
15+
use Contao\CoreBundle\ContaoCoreBundle;
1516
use Contao\CoreBundle\Monolog\ContaoContext;
1617
use Contao\Database;
1718
use Contao\DataContainer;
@@ -1217,10 +1218,21 @@ protected static function generatePalette($table, array $paletteFields = array()
12171218
$palette .= ',type';
12181219
}
12191220
else {
1220-
$palette .= '{type_legend},type';
1221+
$palette .= '{type_legend}';
1222+
if (version_compare(ContaoCoreBundle::getVersion(), '5.6', '>=')) {
1223+
if ($table === 'tl_content') {
1224+
$palette .= ',title';
1225+
}
1226+
}
1227+
else {
1228+
$palette .= ',type';
1229+
}
12211230
if ($table === 'tl_content' && in_array('headline', $standardFields)) {
12221231
$palette .= ',headline';
12231232
}
1233+
if (version_compare(ContaoCoreBundle::getVersion(), '5.6', '>=')) {
1234+
$palette .= ',type';
1235+
}
12241236
if (in_array('columns', $standardFields)) {
12251237
$palette .= ';{rs_columns_legend},' . explode(';', explode('{rs_columns_legend},', $GLOBALS['TL_DCA']['tl_content']['palettes']['rs_columns_start'] ?? '')[1] ?? '')[0];
12261238
}

0 commit comments

Comments
 (0)