bootstrap_package icon indicating copy to clipboard operation
bootstrap_package copied to clipboard

Different TCA definition for rootpages in one TYPO3 instance

Open olivermeckel opened this issue 2 years ago • 2 comments

We've one TYPO3 Installation serving 4 different websites (with own siteconfiguration/domains and content). I'm using TYPO3 10.4.20 with bootstrap_package 11.0.3 and a sitepackage for customizing and extending the bootstrap_package. The websites are structured in the same way and only have different colors and logos. We were able to do this by delivering individual CSS and simple conditions.

Now we want to add an other rootpage to TYPO3. This page will differ significantly from the previous webseites. Therefore it should get its own sitepackage.

So we disabled autoloading RTE, Backenlayouts, TCEMAIN, TCEFORM, Content Element PageTS Configuration in the configuration of the extensions and added them manually in the ressources of the siteconfiguration.

So it looks something like this

rootpage id 1 rootpage id 2 rootpage id 3 rootpage id 4

  • each page is rootlevel, constants and setup ist cleared
  • Include static form extension: "Bootstrap Package - Full Package and "Sitepackage A - Full Package"
  • Include Static Page TSconfig: for "Bootstrap Package" and "Sitepackage A" (Backend Layouts, TCEMAIN, TCEFORM, Content Elements)

rootpage id 5

  • each page is rootlevel, constants and setup ist cleared
  • Include static form extension: "Bootstrap Package - Full Package and "Sitepackage B - Full Package"
  • Include Static Page TSconfig: for "Bootstrap Package" and "Sitepackage B" (Backend Layouts, TCEMAIN, TCEFORM, Content Elements)

So far, so good. We can serve different Backend Layouts, customize TCEMAIN and TCEFORM. Also customizing the templates is no problem. But changes in TCA have an effect on all rootpages. We want to use different cropping ratios for images. When we make changes in the file 500_cropping.php in the TCA Overrides of Sitepackage B, e.g. for carousel images, it effects also the carousels in rootpages with Sitepackage A.

Now my question: Is it possible to have different tca definitions for the same content-element (e.g. for tx_bootstrappackage_carousel_item) in one TYPO3 instance? And how can we achieve that?

Best regards We look forward to your answers

olivermeckel avatar Oct 08 '21 13:10 olivermeckel

@olivermeckel that's simply not possible, but you can adjust values and defaults through TCEFORM and TCAdefaults you get pretty far with that, like disabling fields, adding options or removing options. TCA is always instance-wide.

Do you have an example of why you want to change TCA or what you want to change exactly?

benjaminkott avatar Oct 21 '21 10:10 benjaminkott

In some cases we needed additional fields to extend content elements. We managed this so far. the main point is, that the new layout has different sizes and ratios for the images. so we want to have different default cropping for the editors in the backend.

For example the thumbs in the page settings. The user can add images an crop them manually. We overwrote the settings for: $GLOBALS['TCA']['pages']['types'][$type]['columnsOverrides']['thumbnail']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']['default'] $GLOBALS['TCA']['pages']['types'][$type]['columnsOverrides']['thumbnail']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']['small'] All other configs are unset

This images are then used in the content elements "menu thumbnail list", "menu card list" and so on. For Sitepackage A the default ratio was 1:1, for the Sitepackage B we need the default ratio 16:9 and a special mobil format

The editor should only see this default settings and schould not be able to crop images in other ratios.

olivermeckel avatar Oct 21 '21 10:10 olivermeckel