1
votes

I would like to overwrite the image cropping configuration specifically for the page resources.

In the changelog i can find the following part:

It is also possible to set the cropping configuration only for a specific tt_content element type by using the columnOverrides feature:

$GLOBALS['TCA']['tt_content']['types']['textmedia']['columnsOverrides']['assets']['config']['overrideChildTca']['columns']['crop']['config'] = [ 'cropVariants' => [

I ask myself if there is the possibility to do this specifically for the media files in the page resources.

I tried something like this:

$GLOBALS['TCA']['pages']['types']['media']['columnsOverrides']['assets']['config']['overrideChildTca']['columns']['crop']['config'] = [

But this does not work.

Maybe this does just not work. But if it does i'm looking forward for some hints to achieve this.

Thank you in advance.

2

2 Answers

3
votes

$GLOBALS['TCA']['pages']['columns']['media']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']
will do the job to change the cropVariants for all pagetypes.

If you want to change the cropVariants for a special pagetype, you have to use
$GLOBALS['TCA']['pages']['types']['THE_PAGE_TYPE']['columnsOverrides']['media']['config']['overrideChildTca']['columns']['crop']['config']['cropVariants']

0
votes

You are basically correct but you need to refer to a type value to get this working. For the pages table this would be any value for doktype.

Thus something the following would work:

$GLOBALS['TCA']['pages']['types'][(string)\TYPO3\CMS\Frontend\Page\PageRepository::DOKTYPE_DEFAULT]['columnsOverrides']['assets']['config']['overrideChildTca']['columns']['crop']['config'] = [ ... ];

This sets the cropping configuration only for pages of type Standard.

If you only want to set this for a few selected pages, you'll need to add your own doktype.