Many time we need to extend news with some text fields or any other table relation.
We can directly in news extension. better we can extend through other extension.
For that first we need to create that fields in news table.
So following SQL you need to extend in your extension [ in ext_tables.sql file ]
CREATE TABLE tx_news_domain_model_news ( category int(11) unsigned DEFAULT '0', );
than after you need to add following code in ext_tables.php. this extended category will display before bodytext area.
$extendCategory = array( 'category' => array ( 'exclude' => 0, 'l10n_mode' => 'noCopy', 'label' => 'Sponsors', 'config' => array( 'type' => 'select', 'items' => array ( array('',0), ), 'renderType' => 'selectSingle', 'foreign_table' => 'tx_jsfaq_domain_model_category', 'minitems' => 0, 'maxitems' => 1, ), ), ); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns( 'tx_news_domain_model_news', $extendCategory, 1 ); \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette( 'tx_news_domain_model_news', 'paletteArchive', '--linebreak--,category','after:bodytext' );
If you have any query then feel free to contact me at Jainish Senjaliya