Here i found the information how to set global crop variants for all ctypes.
Now i want to set a focusArea for all ctypes. What would be the best way?
'focusArea' => [
'x' => 1 / 3,
'y' => 1 / 3,
'width' => 1 / 3,
'height' => 1 / 3,
],
答案 0 :(得分:3)
希望您使用扩展程序来提供模板。在这种情况下,您可以将以下代码添加到your_extension/Configuration/TCA/Overrides/sys_file_reference.php
$GLOBALS['TCA']['sys_file_reference']['columns']['crop']['config']['cropVariants'] = [
'demo' => [
'title' => 'Demo',
'allowedAspectRatios' => [
'4:3' => [
'title' => '4:3',
'value' => 4 / 3
],
],
'selectedRatio' => '4:3',
'cropArea' => [
'x' => 0.0,
'y' => 0.0,
'width' => 1.0,
'height' => 1.0,
],
'focusArea' => [
'x' => 1 / 3,
'y' => 1 / 3,
'width' => 1 / 3,
'height' => 1 / 3,
],
'coverAreas' => [
[
'x' => 0.05,
'y' => 0.85,
'width' => 0.9,
'height' => 0.1,
]
],
],
];
这会将cropVariant demo
添加到:
请注意,这将适用于所有sys_file_reference而不仅适用于CTypes,因此页面,新闻等也会受到影响。