1
votes

I need to create a flexform field where the user is able to select a tt_content element - but I want to limit that to only tt_content elements from a certain page. What I have so far:

<settings.test>
    <TCEforms>
        <label>test</label>
        <config>
            <type>group</type>
            <internal_type>db</internal_type>
            <allowed>tt_content</allowed>
            <size>1</size>
            <maxitems>1</maxitems>
            <minitems>0</minitems>
            <show_thumbs>1</show_thumbs>
        </config>
    </TCEforms>
</settings.test>

is there a way to limit it to a specific page? The typo3 Version is 7.6.10.

Thank you in advance.

1
I think the property filter is what you need, together with a user function that removes all tt_content elements not being on the specific page.Jost

1 Answers

2
votes

The <type>group</type> is used for a browselike behavior and i can not see how you can add a filter there. Since you want to show a limited number of elements, you can use <type>select</type> with foreign_table_where

    <config>
        <type>select</type>
        <renderType>selectSingle</renderType>
        <foreign_table>tt_content</foreign_table>
        <foreign_table_where>AND tt_content.pid = ###PAGE_TSCONFIG_ID###</foreign_table_where>
        <size>1</size>
        <items>
            <numindex index="0">
                <numindex index="0">--</numindex>
                <numindex index="1"></numindex>
            </numindex>
        </items>
        <maxitems>1</maxitems>
        <minitems>0</minitems>
    </config>

Then you need to set the id in your Page Config

TCEFORM.tt_content.pi_flexform.PAGE_TSCONFIG_ID = 123