【问题标题】:TYPO3 Backend - Search first_name of fe_usersTYPO3 后端 - 搜索 fe_users 的 first_name
【发布时间】:2019-03-16 13:10:21
【问题描述】:

按照我的 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 用户。有没有办法搜索他们的名字?如果是怎么办?

【问题讨论】:

  • 这种类型的字段应该自动在选择字段旁边添加一个搜索字段。您是尝试在那里搜索还是想要在单击“网站用户”后在弹出窗口中添加搜索功能?

标签: typo3 typo3-9.x


【解决方案1】:

您需要“额外的搜索字段”。比如:

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

编辑附加搜索字段列表以仅包含您要搜索的字段,例如first_name

附加搜索字段(字符串) 建议向导还应搜索的字段的逗号分隔列表。默认情况下,向导仅查找 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 代替了建议向导。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多