Skip to content

Instantly share code, notes, and snippets.

@markocupic
Last active July 29, 2021 10:16
Show Gist options
  • Save markocupic/41496afeef407c975fa7f88fcb8ccd00 to your computer and use it in GitHub Desktop.
Save markocupic/41496afeef407c975fa7f88fcb8ccd00 to your computer and use it in GitHub Desktop.
Extending tl_calendar_events_member.php
<?php
// For contao > 4.4:
// For extending your dca, store your custom dca file in: TL_ROOT/contao/dca/tl_calendar_events_member.php
use Contao\CoreBundle\DataContainer\PaletteManipulator;
PaletteManipulator::create()
->addField(
['mycustom1', 'mycustom2'],
'notes_legend',
PaletteManipulator::POSITION_APPEND
)
->applyToPalette(
'default',
'tl_calendar_events_member'
);
$GLOBALS['TL_DCA']['tl_calendar_events_member']['fields']['mycustom1'] = [
'filter' => true,
'sorting' => true,
'search' => true,
'inputType' => 'text',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
];
$GLOBALS['TL_DCA']['tl_calendar_events_member']['fields']['mycustom2'] = [
'filter' => true,
'sorting' => true,
'search' => true,
'inputType' => 'text',
'eval' => ['maxlength' => 255, 'tl_class' => 'w50'],
'sql' => "varchar(255) NOT NULL default ''",
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment