DJCrispyRice
DJCrispyRice

Reputation: 78

TCA/Flexform : filter 2 kind of objects from two mm tables by same parameter

I have a flexform that allows the user to choose two types of objects : a video or a playlist. Both have a category. I am trying to create a flexform for the user to select an item by category. Here is my flexform and my tt_content :

<settings.items>
<TCEforms>
    <label>Vidéos | Playlists</label>
    <config>
        <type>group</type>
        <internal_type>db</internal_type>
        <allowed>...video, ...playlist</allowed>
        <size>10</size>
        <maxitems>99</maxitems>
        <minitems>0</minitems>
    </config>
</TCEforms>
</settings.items>

tt_content :

'video_categorie_uid' => [
    'displayCond' => 'FIELD:list_type:=:myplugin',
    'exclude' => true,
    'label' => 'Catégorie vidéo',
    'config' => [
        'type' => 'group',
        'internal_type' => 'db',
        'allowed' => '...categorie',
        'size' => 1,
        'maxitems' => 1,
        'eval' => 'required'
    ]

The problem is that I have two different mm tables for those relations (a video_category and a playlist_category). At the moment, the user can select what he wants but every item appears whereas I want the list to be filtered by the category selected in "video_categorie_uid" field. Is there a way to have one field that allows to select two types of items that should refer to two differents MM tables ?

Thanks !

Upvotes: 0

Views: 160

Answers (0)

Related Questions