Flexform中的TYPO3 FAL

我有一个带有以下代码的flexform。

<image>
    <TCEforms>
        <label>LLL:EXT:my_slider/Resources/Private/Language/locallang.xlf:flexform.slider.main.slider.image</label>
        <config>
            <type>group</type>
            <internal_type>file</internal_type>
            <allowed>jpg, jpeg, gif, png</allowed>
            <show_thumbs>1</show_thumbs>
            <minitems>0</minitems>
            <maxitems>1</maxitems>
            <size>1</size>
        </config>
    </TCEforms>
</image>

直到现在还能用。但现在在TYPO3 10中我得到了这个错误。

表tt_content中 “image “字段的TCA internal_type必须设置为 “db “或 “文件夹”。

我如何解决这个问题?我如何将我的flexform迁移到FAL?我已经测试了一些解决方案,但它们的结果都是。

Invalid flex form data structure on field name “pi_flexform” with element “image” in section container “sliderConfiguration” 无效的flex form数据结构。不允许在flex表单部分嵌套内联元素。

如果我写

<el>
    <settings.slider type="array">
    <title>LLL:EXT:my_slider/Resources/Private/Language/locallang.xlf:flexform.slider.main.slider</title>
    <type>array</type>
    <section>1</section>
    <el>
        <sliderConfiguration>
            <type>array</type>
            <title>LLL:EXT:my_slider/Resources/Private/Language/locallang.xlf:flexform.slider.main.slider.slide</title>
            <el>
                <media>
                    <!-- https://stackoverflow.com/questions/47554243/how-to-add-cropvariants-to-an-image-field-in-typo3-flexform -->
                    <TCEforms>
                        <label>
                            LLL:EXT:va_template/Resources/Private/Language/locallang.xlf:content_element.backgroundtext.settings.image
                        </label>
                        <config>
                            <type>inline</type>
                            <minitems>1</minitems>
                            <maxitems>1</maxitems>
                            <appearance type="array">
                                <enabledControls type="array">
                                    <delete>1</delete>
                                    <dragdrop>1</dragdrop>
                                    <new>0</new>
                                    <hide>1</hide>
                                    <info>1</info>
                                </enabledControls>
                                <fileUploadAllowed>1</fileUploadAllowed>
                                <headerThumbnail type="array">
                                    <field>uid_local</field>
                                    <height>100c</height>
                                    <width>100</width>
                                </headerThumbnail>
                                <useSortable>1</useSortable>
                            </appearance>
                            <foreign_field>uid_foreign</foreign_field>
                            <foreign_label>uid_local</foreign_label>
                            <foreign_match_fields type="array">
                                <fieldname>media</fieldname>
                            </foreign_match_fields>
                            <foreign_selector>uid_local</foreign_selector>
                            <foreign_sortby>sorting_foreign</foreign_sortby>
                            <foreign_table>sys_file_reference</foreign_table>
                            <foreign_table_field>tablenames</foreign_table_field>
                        </config>
                    </TCEforms>
                </media>

然后我得到这个错误

在部分容器 “sliderConfiguration “中,字段名 “pi_flexform “中的 “media “元素无效的flex表单数据结构。不允许在flex表单部分嵌套内联元素。

解决方案:

我在这里写了完整的flexform配置,它将与typo3 10一起运行。

<image>
                <TCEforms>
                    <label>LLL:EXT:ns_theme_healthy/Resources/Private/Language/locallang_flex.xlf:general.image</label>
                    <config>
                        <type>inline</type>
                        <maxitems>1</maxitems>
                        <foreign_table>sys_file_reference</foreign_table>
                        <foreign_table_field>tablenames</foreign_table_field>
                        <foreign_label>uid_local</foreign_label>
                        <foreign_sortby>sorting_foreign</foreign_sortby>
                        <foreign_field>uid_foreign</foreign_field>
                        <foreign_selector>uid_local</foreign_selector>
                        <foreign_selector_fieldTcaOverride>
                            <config>
                                <appearance>
                                    <elementBrowserType>file</elementBrowserType>
                                    <elementBrowserAllowed>gif,jpg,jpeg,png,svg</elementBrowserAllowed>
                                </appearance>
                            </config>
                        </foreign_selector_fieldTcaOverride>
                        <foreign_types type="array">
                            <numIndex index="0">
                                <showitem>--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
                            </numIndex>
                            <numIndex index="2">
                                <showitem>--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
                            </numIndex>
                        </foreign_types>
                        <foreign_match_fields>
                            <fieldname>image</fieldname> <!-- CAUTION!! Replace "fal" with the variable name of this field! -->
                        </foreign_match_fields>
                        <appearance type="array">
                            <newRecordLinkAddTitle>1</newRecordLinkAddTitle>
                            <headerThumbnail>
                                <field>uid_local</field>
                                <height>64</height>
                                <width>64</width>
                            </headerThumbnail>
                            <enabledControls>
                                <info>1</info>
                                <new>0</new>
                                <dragdrop>0</dragdrop>
                                <sort>1</sort>
                                <hide>0</hide>
                                <delete>1</delete>
                                <localize>1</localize>
                            </enabledControls>
                            <createNewRelationLinkTitle>LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference</createNewRelationLinkTitle>
                        </appearance>
                        <behaviour>
                            <localizationMode>select</localizationMode>
                            <localizeChildrenAtParentLocalization>1</localizeChildrenAtParentLocalization>
                        </behaviour>
                        <overrideChildTca>
                            <columns type="array">
                                <uid_local type="array">
                                    <config type="array">
                                        <appearance type="array">
                                            <elementBrowserType>file</elementBrowserType>
                                            <elementBrowserAllowed>jpg,png,svg,jpeg,gif</elementBrowserAllowed>
                                        </appearance>
                                    </config>
                                </uid_local>
                            </columns>
                            <types type="array">
                                <numIndex index="2">
                                    <showitem>--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,--palette--;;filePalette</showitem>
                                </numIndex>
                            </types>
                        </overrideChildTca>
                    </config>
                </TCEforms>
            </image>

给TA打赏
共{{data.count}}人
人已打赏
未分类

联动列表队列编号移动

2022-9-8 15:24:40

未分类

layout.xml文件不被识别,直到我取消缓存并重新启动。

2022-9-8 15:24:42

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索