Skip to content

Instantly share code, notes, and snippets.

@stefansl

stefansl/dcaconfig.php

Last active Jun 15, 2018
Embed
What would you like to do?
Some personal improvements in Contao (/system/config/dcaconfig.php)
// Reihenfolge der Headline-Typen ändern
$GLOBALS['TL_DCA']['tl_content']['fields']['headline']['options']= array('h2', 'h3', 'h4', 'h5', 'h6', 'h1');
// Artikel und Seiten standardmäßig auf 'veröffentlicht' stellen
$GLOBALS['TL_DCA']['tl_article']['fields']['published']['default'] = true;
$GLOBALS['TL_DCA']['tl_page']['fields']['published']['default'] = true;
// HTML in Überschriften erlauben
$GLOBALS['TL_DCA']['tl_content']['fields']['headline']['eval']['allowHtml'] = true;
// Standard Content-Element auf 'Headline' ändern
$GLOBALS['TL_DCA']['tl_content']['fields']['type']['default'] = 'headline';
// Seiten-ID anzeigen
$GLOBALS['TL_DCA']['tl_page']['list']['label']['fields'][] = 'id';
$GLOBALS['TL_DCA']['tl_page']['list']['label']['format'] = '%s <span style="color: #bbb; padding-left: 3px; font-size: 0.9em;">(%s.html ID: %s)</span>';
// Artikel-ID anzeigen
$GLOBALS['TL_DCA']['tl_article']['list']['label']['fields'][] = 'id';
$GLOBALS['TL_DCA']['tl_article']['list']['label']['format'] = '%s <span style="color: #bbb; padding-left: 3px; font-size: 0.9em;">(%s.html, ID: %s)</span>';
// Deaktivieren der Update-Anzeige für Nicht-Admins
if (!\BackendUser::getInstance()->isAdmin) {
foreach ((array) $GLOBALS['TL_HOOKS']['getSystemMessages'] as $k => $arrHook) {
if ($arrHook[1] == 'versionCheck') {
unset($GLOBALS['TL_HOOKS']['getSystemMessages'][$k]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment