TYPO3后端-搜索fe_users的first_name

时间:2019-03-16 13:10:22

标签: typo3 typo3-9.x

遵循我的TCA:

'fe_user' => [
        'exclude' => 0,
        'label' => 'FE-Users',
        'config' => [
            'type' => 'group',
            'internal_type' => 'db',
            'allowed' => 'fe_users',
            'foreign_table' => 'fe_users',
            'size' => 1,
            'minitems' => 0,
            'maxitems' => 1
        ],
    ],

当我单击后端中的“网站用户”时,我可以搜索FE用户。有没有办法搜索他们的名字?如果是,怎么办?

1 个答案:

答案 0 :(得分:2)

您需要“ additionalSearchFields”。像这样:

[...]
'config' => [
    [...]
    'suggestOptions' => [
        'default' => [
            'additionalSearchFields' => 'name,first_name,last_name,middle_name,address,telephone,fax,email,title,zip,city,country,company,description'
        ]
    ]
]

编辑AdditionalSearchFields列表,以仅包括您要搜索的字段,例如first_name

  

additionalSearchFields(字符串)   建议向导也应在其中搜索的字段的逗号分隔列表。默认情况下,该向导仅在TCA ctrl属性的label和label_alt中列出的字段中查找。

参考:https://docs.typo3.org/typo3cms/TCAReference/ColumnsConfig/Type/Group.html?highlight=additionalsearchfields#suggestoptions

此type = group的“ suggestOptions”为added in TYPO3 8.6,代替了建议向导。