Add related DB fields
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Contao\CoreBundle\DataContainer\PaletteManipulator;
|
||||
|
||||
$dca = &$GLOBALS['TL_DCA']['tl_news'];
|
||||
|
||||
PaletteManipulator::create()
|
||||
->addLegend('meilisearch_legend', 'pal_expert_legend', PaletteManipulator::POSITION_AFTER)
|
||||
->addField('priority', 'meilisearch_legend')
|
||||
->addField('keywords', 'meilisearch_legend')
|
||||
->applyToPalette('default', 'tl_news');
|
||||
|
||||
/**
|
||||
* Priority
|
||||
*/
|
||||
$dca['fields']['priority'] = [
|
||||
'inputType' => 'select',
|
||||
'options' => [1, 2, 3],
|
||||
'reference' => &$GLOBALS['TL_LANG']['MSC']['meilisearch_priority'],
|
||||
'default' => 2,
|
||||
'eval' => ['tl_class' => 'w50'],
|
||||
'sql' => "int(1) NOT NULL default '2'"
|
||||
];
|
||||
|
||||
/**
|
||||
* Keywords
|
||||
*/
|
||||
$dca['fields']['keywords'] = [
|
||||
'inputType' => 'text',
|
||||
'eval' => ['tl_class' => 'w50', 'maxlength' => 255],
|
||||
'sql' => "varchar(255) NOT NULL default ''"
|
||||
];
|
||||
Reference in New Issue
Block a user