0

How do I add the core gallerySettings palette to the media tab of tx_news? I want to be able to use these settings in the news detail template.

In my site package I have tried adding this to my tt_content.php:

\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
    'tx_news_domain_model_media',
    '---palette--;;gallerySettings',
    '',
    'after:fal_media'
);
user500665
  • 1,220
  • 1
  • 12
  • 38

2 Answers2

1

It's not possible to reuse a palette from a different table. What you could do is to implement the relevant code from tt_content in your extension.

That's the TCA as well as database table definitions and the necessary TypoScript. Please consult typo3/sysext/fluid_styled_content for details of the frontend output. TYPO3\CMS\Frontend\DataProcessing\GalleryProcessor is what you need.

Peter Kraume
  • 3,577
  • 2
  • 21
  • 39
  • So I just need to create new fields and palette using `tx_news_domain_modal_news.php`, and use the same code as above to add them? Or do I still use `tt_content.php` and just add the new fields to the `tx_news_domain_model_media` table? – user500665 Jan 30 '22 at 21:04
  • Yes, create the database fields and the TCA with table definitions and implement the frontend output. But put everything in your own extension. Georg has created a [good documentation how to extend his news extension](https://docs.typo3.org/p/georgringer/news/main/en-us/Tutorials/ExtendNews/Index.html). – Peter Kraume Jan 31 '22 at 07:25
0

tt_content and tx_news_domain_model_news are two different tables. you cannot add fields from the one to the other.

Lina
  • 1