We are setting up a news integration for one of our customers and he needs the content element feature. But when adding a new content element to the News the system always selects an inexisting colPos. Through this, you can't specify the type of the content element before the colPos got changed.
Is it possible to change the default colPos from 0 to 1 or so?
I have tried to set the colPos by following code in the PageTS but it hasn't worked out for me.
TCEFORM.tt_content.colPos.config.default = 1
TCAdefaults.tt_content.colPos = 1
will force default value for all tt_content entries in this page (page tree).
Best way would be to set default value for news content elements only. This can be done with override child TCA
In TYPO3 version 7.6
$GLOBALS['TCA']['tx_news_domain_model_news']['columns']['content_elements']['config']['foreign_record_defaults']['colPos'] = '1';
In TYPO3 version 8.6 and 9.5
$GLOBALS['TCA']['tx_news_domain_model_news']['columns']['content_elements']['config']['overrideChildTca']['columns']['colPos']['config']['default'] = '1';
This can be configured in a custom project extension under ../Configuration/TCA/Overrides/tx_news_domain_model_news.php