Flexform 中的 TYPO3 FAL [英] TYPO3 FAL in Flexform

查看:23
本文介绍了Flexform 中的 TYPO3 FAL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a flexform with following code:

<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 中,我收到此错误:

Until now this worked. But now in TYPO3 10 I get this error:

表 tt_content 中字段 "image" 的 TCA internal_type 必须设置为 "db" 或 "folder".

TCA internal_type of field "image" in table tt_content must be set to "db" or "folder".

我该如何解决这个问题?如何将我的 flexform 迁移到 FAL?我已经测试了一些解决方案,但最终结果是:

How can I resolve this? How can I migrate my flexform to FAL? I've testet a few solutions but they ended in:

字段名称pi_flexform"和元素image"在部分容器sliderConfiguration"中无效的 flex 表单数据结构:不允许在 flex 表单部分中嵌套内联元素.

Invalid flex form data structure on field name "pi_flexform" with element "image" in section container "sliderConfiguration": Nesting inline elements in flex form sections is not allowed.

如果我写

<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>

然后我得到这个错误

字段名称pi_flexform"和元素media"在部分容器sliderConfiguration"中无效的 flex 表单数据结构:不允许在 flex 表单部分中嵌套内联元素.

Invalid flex form data structure on field name "pi_flexform" with element "media" in section container "sliderConfiguration": Nesting inline elements in flex form sections is not allowed.

推荐答案

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

I have written here the full flexform config which will run with 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>

我已经测试了这将是我全新的typo3 10 项目.

I have tested this will my all-new typo3 10 projects.

希望对你有帮助.谢谢!

I hope it helps you. Thank you!

这篇关于Flexform 中的 TYPO3 FAL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆