Cómo agregar cropVariants a un campo de imagen en TYPO3 flexform
Puedo anular cropVaraints para un campo de imagen en TCA como este:
'columnsOverrides' => [
'image' => [
'label' => 'LLL:EXT:myext/Resources/Private/Language/locallang_be.xlf:general.field.image',
'config' => [
'overrideChildTca' => [
'columns' => [
'crop' => [
'config' => [
'cropVariants' => [
'default' => [
'title' => 'LLL:EXT:myext/Resources/Private/Language/locallang_be.xlf:wizard.banner.title',
'allowedAspectRatios' => [
'2:1' => [
'title' => 'LLL:EXT:myext/Resources/Private/Language/locallang_be.xlf:field.banner.image-crop.ratio',
'value' => 2 / 1
],
],
],
],
],
],
],
],
],
],
],
Intenté adaptar esto a flexform, pero sin ningún éxito. Entonces, lo que necesito es algo como esto (pero funciona :-))
<foreign_selector_fieldTcaOverride type="array">
<config>
<appearance>
<elementBrowserType>file</elementBrowserType>
<elementBrowserAllowed>jpg,png</elementBrowserAllowed>
</appearance>
<overrideChildTca>
<columns>
<crop>
<config>
<cropVariants>
<default>
<title>Blubber</title>
<allowedAspectRatios>
<test>
<title>2:1</title>
<value>2 / 1</value>
</test>
</allowedAspectRatios>
</default>
</cropVariants>
</config>
</crop>
</columns>
</overrideChildTca>
</config>
</foreign_selector_fieldTcaOverride>
¿Alguien hizo eso antes?
Si no es posible, ¿puedo acercarme a la forma flexible? Actualmente tengo un elemento de gridelement con un campo de imagen.
[ACTUALIZACIÓN] Como señaló @fnagel, debería ser posible anular el valor predeterminado, por lo que traté de poner lo siguiente en mi Overrides / sys_file_reference.php, pero no tiene ningún efecto, incluso no pude encontrar esa definición predeterminada en TCA-Inspector ...
$GLOBALS['TCA']['sys_file_reference']['columns']['crop']['config']['cropVariants']['default'] = [
'title' => 'LLL:EXT:al_template/Resources/Private/Language/locallang_be.xlf:wizard.gallery.title',
'allowedAspectRatios' => [
'NaN' => [
'title' => 'LLL:EXT:al_template/Resources/Private/Language/locallang_be.xlf:field.gallery.image-crop.ratio',
'value' => 0.0
],
],
];
escribir ot como tampoco tiene efecto ...
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule(
$GLOBALS['TCA']['sys_file_reference'],
[
'columns' =>[
'crop' => [
'config' => [
'cropVariants' => [
'default'=> [
'title' => 'LLL:EXT:al_template/Resources/Private/Language/locallang_be.xlf:wizard.gallery.title',
'allowedAspectRatios' => [
'NaN' => [
'title' => 'LLL:EXT:al_template/Resources/Private/Language/locallang_be.xlf:field.gallery.image-crop.ratio',
'value' => 0.0
],
],
],
],
],
],
],
]
);
¿Alguien con una configuración exitosa para eso?