add field in tl_page palettes
Hello,
I want to add the field in the page form with a extension.
But I don't have the error message...
Code:
// Modify palette
$GLOBALS['TL_DCA']['tl_page']['palettes']['default'] = str_replace('alias', 'test_check;alias', $GLOBALS['TL_DCA']['tl_page']['palettes']['default']);
// Add field
$GLOBALS['TL_DCA']['tl_page']['fields']['test_check'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_page']['test_check'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array(
)
);
this code is true ? ?
Re: add field in tl_page palettes
Have you also updated the database so test_check field exists in tl_page table?
Re: add field in tl_page palettes
yes.. the database is updated...
Re: add field in tl_page palettes
Well, the code seems to be correct. What's the problem? The field does not display?
Re: add field in tl_page palettes
what is the name of the directory that contains the extension?
Re: add field in tl_page palettes
system > drop_navigation > dca > tl_page.php
The field does not display
Re: add field in tl_page palettes
It should be /system/modules/drop_navigation/dca/tl_page.php
Re: add field in tl_page palettes
the page dca has several palettes, I think you are not showing the "default" palette
try to add your field to the "regular" palette
Code:
$GLOBALS['TL_DCA']['tl_page']['palettes']['regular']
Re: add field in tl_page palettes
yes ! !
thanks ga.n
this is the correct code :
Code:
$GLOBALS['TL_DCA']['tl_page']['palettes']['regular'] = str_replace('title', 'title,dn_check', $GLOBALS['TL_DCA']['tl_page']['palettes']['regular']);
// Add field
$GLOBALS['TL_DCA']['tl_page']['fields']['dn_check'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_page']['dn_check'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50')
);