简体   繁体   中英

TCA Suggest Wizard with select field (side by side)

In a TYPO3 8.7 Backend / TCA, I'm trying to add a suggest wizard to a select field of the type selectMultipleSideBySide .

There are already two other wizards, add and edit, which work, while suggest doesn't.

'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
                        ]
                    ],
                ],
            ],
        ],

I admit I got the code for the suggest wizard from a group field (where it works). But I need the side by side view in the backend, not the group view.

What I now get is

在此处输入图片说明

But I'd like a search box on top of it. Where can I find some example code?

Turns out what I wanted is not the a wizard at all! But a so called MultiSelectFilterTextfield

Simply adding 'enableMultiSelectFilterTextfield' => true, to config did the trick, so

'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'
                        ],
                    ],
                ],
            ],
        ],

Will produce

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM