0

在 TYPO3 8.7 后端/TCA 中,我正在尝试将建议向导添加到 type 的选择字段中selectMultipleSideBySide

已经有另外两个向导,添加和编辑,它们可以工作,而建议不能。

'genres' => [
            'exclude' => false,
            'label' => 'Genres',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectMultipleSideBySide',
                'foreign_table' => 'tx_myext_domain_model_genre',
                'MM' => 'tx_myext_project_genre_mm',
                'size' => 10,
                'autoSizeMax' => 30,
                'maxitems' => 9999,
                'multiple' => 0,
                'wizards' => [
                    '_PADDING' => 1,
                    '_VERTICAL' => 1,
                    'edit' => [
                        'module' => [
                            'name' => 'wizard_edit',
                        ],
                        'type' => 'popup',
                        'title' => 'Edit', 
                        'icon' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_edit.gif',
                        'popup_onlyOpenIfSelected' => 1,
                        'JSopenParams' => 'height=350,width=580,status=0,menubar=0,scrollbars=1',
                    ],
                    'add' => [
                        'module' => [
                            'name' => 'wizard_add',
                        ],
                        'type' => 'script',
                        'title' => 'Create new',
                        'icon' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_add.gif',
                        'params' => [
                            'table' => 'tx_myext_domain_model_genre',
                            'pid' => '###CURRENT_PID###',
                            'setValue' => 'prepend'
                        ],
                    ],
                    'suggest' => [
                        'type' => 'suggest',
                        'tx_myext_domain_model_genre' => [
                            'maxItemsInResultList' => 25,
                        ],
                        'default' => [
                            'searchWholePhrase' => 1
                        ]
                    ],
                ],
            ],
        ],

我承认我从一个组字段(它工作的地方)获得了建议向导的代码。但我需要后端的并排视图,而不是组视图。

我现在得到的是

在此处输入图像描述

但我想要一个搜索框。我在哪里可以找到一些示例代码?

4

1 回答 1

1

原来我想要的根本不是巫师!但是一个所谓的MultiSelectFilterTextfield

只需添加'enableMultiSelectFilterTextfield' => true,到配置就可以了,所以

'genres' => [
            'exclude' => false,
            'label' => 'Genres',
            'config' => [
                'type' => 'select',
                'renderType' => 'selectMultipleSideBySide',
                'foreign_table' => 'tx_myext_domain_model_genre',
                'MM' => 'tx_myext_project_genre_mm',
                'size' => 10,
                'autoSizeMax' => 30,
                'maxitems' => 9999,
                'multiple' => 0,
                'enableMultiSelectFilterTextfield' => true, // <---- HERE
                'wizards' => [
                    '_PADDING' => 1,
                    '_VERTICAL' => 1,
                    'edit' => [
                        'module' => [
                            'name' => 'wizard_edit',
                        ],
                        'type' => 'popup',
                        'title' => 'Edit', 
                        'icon' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_edit.gif',
                        'popup_onlyOpenIfSelected' => 1,
                        'JSopenParams' => 'height=350,width=580,status=0,menubar=0,scrollbars=1',
                    ],
                    'add' => [
                        'module' => [
                            'name' => 'wizard_add',
                        ],
                        'type' => 'script',
                        'title' => 'Create new',
                        'icon' => 'EXT:backend/Resources/Public/Images/FormFieldWizard/wizard_add.gif',
                        'params' => [
                            'table' => 'tx_myext_domain_model_genre',
                            'pid' => '###CURRENT_PID###',
                            'setValue' => 'prepend'
                        ],
                    ],
                ],
            ],
        ],

会产生

在此处输入图像描述

于 2018-09-18T14:50:44.770 回答