[SOLVED] Typo3 V12 Images in FlexForm in Sections

Hi,

in Typo3 V11 i used the Group-Type to get images in a Section because as far as i know, FAL did not work in Sections.
In V12 this doesn’t work anymore. The Wizard didn’t show the available Files or the Pages anymore.

Can somebody tell me to configure something like this for Typo3 v12 or hint me in the direction how this should be done?

Configuration from Version 11:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
    <sheets>
        
        <content>
            <ROOT>
                <TCEforms>
                    <sheetTitle>Slides</sheetTitle>
                </TCEforms>
                <type>array</type>
                <el>
                    <!-- Add settings here ... -->

                    <slides>
                        <title>Slide-Elemente</title>
                        <type>array</type>
                        <section>1</section>
                        <el>
                            <slide>
                                <title>Slide mit Bild oder Video</title>
                                <type>array</type>
                                <el>
                                    <image>
                                        <TCEforms>
                                            <label>Bild (1920x920px)</label>
                                            <config>

                                                <type>group</type>

                                                <allowed>sys_file</allowed>
                                                <appearance>
                                                    <elementBrowserAllowed>jpg,jpeg,png,gif</elementBrowserAllowed>
                                                    <elementBrowserType>file</elementBrowserType>
                                                </appearance>
                                                <show_thumbs>1</show_thumbs>
                                                <size>1</size>
                                                <maxitems>1</maxitems>
                                                <minitems>0</minitems>



                                            </config>
                                        </TCEforms>
                                    </image>
                                    

                                    <text>
                                        <TCEforms>
                                            <label>Text</label>
                                            <config>
                                                <type>text</type>

                                            </config>
                                        </TCEforms>
                                    </text>
                                    <linktext>
                                        <TCEforms>
                                            <label>Linktext</label>
                                            <config>
                                                <type>input</type>
                                                <default>Jetzt informieren</default>
                                            </config>
                                        </TCEforms>
                                    </linktext>
                                    <link>
                                    <TCEforms>
                                        <label>Link</label>
                                        <config>
                                            <type>input</type>
                                            <renderType>inputLink</renderType>
                                            <size>30</size>
                                            <eval>trim</eval>
                                            <softref>typolink,typolink_tag,images,url</softref>
                                            <fieldControl>
                                                <linkPopup>
                                                    <options>
                                                        <!--<blindLinkOptions>file,mail,page,spec,url</blindLinkOptions>-->
                                                        <!--<blindLinkFields>class,params,target,title</blindLinkFields>-->
                                                    </options>
                                                </linkPopup>
                                            </fieldControl>
                                        </config>
                                    </TCEforms>
                                    </link>
                                    
                                </el>
                            </slide>
                        </el>
                    </slides>

                    <!-- end of settings -->

                </el>

            </ROOT>
        </content>
    </sheets>
</T3DataStructure>

Thanks
David

https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/Type/User/Index.html

Hi @voduun!

As @lvullriede correctly indicates with his link, the configuration is a good place to start. I also infer that he suggests that you should create a custom (aka. “user”) input type. The documentation is available for different TYPO3 versions. Here’s a link to the documentation for the two versions you mention:

However, as you correctly mention, FlexForm does not support file relations, and you should instead use a database field.

As @derhansen points out in a bug report concerning this issue, there is a hacky workaround using a link to a file:

 <image>
    <TCEforms>
        <label>Select Image</label>
        <config>
            <type>link</type>
            <allowedTypes>
                <numIndex index="0">file</numIndex>
            </allowedTypes>
            <minitems>0</minitems>
            <maxitems>1</maxitems>
        </config>
    </TCEforms>
</image>

@lolli gives a full explanation of why FlexForms won’t support file relations in his comment to another bug report:

Relations to sys_file should be done using tca type=file, which is an inline configuration over sys_file_references.

The fact you’re using type=group here is probably a workaround since type=inline and type=file are not allowed in section containers, and FormEngine throws an exception in this case. It’s a bug in the core that it does not throw for type=group and type=select with MM, foreign_table or allowed as well, when nested in section containers.

The background is that section containers are an anonymous structure. Allowing relations to database entities is a misconception the core can’t handle. The existing usages are so full of bugs that we’re going to restrict this further. Instead, we’re trying to at least allow and fix long standing open bugs with inline,group,file,select on sheet element level, which is tricky enough.