- Go into system/modules
- Create a folder with the name you want (Logically, his name should be newsExtended)
- Create classic folders (dca / languages + your language inside languages) -- The folder config isn't necessary for this kind on extension
- Create the file "tl_news.php" in dca folder
- You will need to override the subpalette called "addImage" (I think it's in this way you want to do it) and create some fields.
To override the palettes, just use str_replace :
PHP Code:
$GLOBALS['TL_DCA']['tl_news']['subpalettes']['addImage'] = str_replace(',floating',',floating,field1,field2',$GLOBALS['TL_DCA']['tl_news']['subpalettes']['addImage']);
It will add your fields "field1" and "field2" when you check the checkbox "addImage".
To add fields, just create it in the way you create fields of a module :
PHP Code:
$GLOBALS['TL_DCA']['tl_news']['fields']['field1'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_news']['field1'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => array('filesOnly'=>true, 'extensions'=>Config::get('validImageTypes'), 'fieldType'=>'radio', 'mandatory'=>true),
'sql' => "binary(16) NULL"
);
Go to your install.php to add the fields to the database
Finally, optionnal thing but it's better to do it :
- Create the file "tl_news.xlf " in "languages/**YourLanguage**/ folder created previously
- Add your label
You can override a DCA on the way you want now !
If you have questions on a specific point, or if you want more details, you can ask ;-)
Bookmarks