【发布时间】:2021-04-20 16:11:58
【问题描述】:
我目前正在使用 Flux 将 TYPO3 项目更新到 TYPO3 10,现在我想将所有字段迁移到 FieldViewhelper。
几乎所有的 Fields 都很好,但带有 CropVariants 的 Inline Fal 元素有点棘手。我不知道如何在配置选项中正确实现这一点。
我的字段目前如下所示:
{f:variable(name: '_allowedFileExtensions', value: '{allowedFileExtensions}')}
{f:variable(name: '_disallowedFileExtensions', value: '{disallowedFileExtensions}')}
<f:variable name="config" value="{
type: 'inline',
foreign_table: 'sys_file_reference',
foreign_field: 'uid_foreign',
foreign_sortby: 'sorting_foreign',
foreign_table_field: 'tablenames',
foreign_match_fields: {
fieldname: name
},
foreign_label: 'uid_local',
foreign_selector: 'uid_local',
maxitems: maxitems,
minitems: minitems,
multiple: multiple,
overrideChildTca: {
columns: {
uid_local: {
config: {
appearance: {
elementBrowserType: 'file',
elementBrowserAllowed: _allowedFileExtensions
}
}
}
},
types: {
0: {
showitem: '--palette--;;imageoverlayPalette, --palette--;;filePalette'
},
1: {
showitem: '--palette--;;imageoverlayPalette, --palette--;;filePalette'
},
2: {
showitem: '--palette--;;imageoverlayPalette, --palette--;;filePalette'
},
3: {
showitem: '--palette--;;audioOverlayPalette, --palette--;;filePalette'
},
4: {
showitem: '--palette--;;videoOverlayPalette, --palette--;;filePalette'
},
5: {
showitem: '--palette--;;imageoverlayPalette, --palette--;;filePalette'
}
}
},
filter: {
0: {
userFunc: 'TYPO3\\CMS\\Core\\Resource\\Filter\\FileExtensionFilter->filterInlineChildren',
parameters: {
allowedFileExtensions: _allowedFileExtensions,
disallowedFileExtensions: _disallowedFileExtensions
}
}
},
appearance: {
useSortable: 1,
headerThumbnail: {
field: 'uid_local',
width: '45',
height: '45c'
},
showPossibleLocalizationRecords: 0,
showRemovedLocalizationRecords: 0,
showSynchronizationLink: 0,
showAllLocalizationLink: 0,
enabledControls: {
info: 1,
new: 0,
dragdrop: 1,
sort: 0,
hide: 1,
delete: 1,
localize: 1
}
}
}" />
<flux:field type="inline" name="{name}" label="{label}" config="{config}" exclude="0"/>
理论上我可以做这样的事情;这就是我在下面的 TCA 区域的方式overrideChildTca:
['columns']['crop']['config'] =>
'cropVariants' => [
'heroimage' => [
'title' => 'Hero Image',
'allowedAspectRatios' => [
'1504x846' => [
'title' => '1504:846',
'value' => 1504 / 846
],
],
],
],
我无法让它工作?有人对如何正确配置示例有任何想法吗?谢谢!
【问题讨论】:
-
请用英文写下您的问题!
-
您是否尝试简单地将
cropVariants添加到与appearance处于同一级别的config变量? -
未声明的参数传递给 ViewHelper FluidTYPO3\Flux\ViewHelpers\FieldViewHelper:cropVariants。有效的参数是:类型、名称、标签、排除、配置、转换、onChange、displayCond、继承、继承空、扩展名
标签: typo3 flux fluid typo3-10.x