studiomitte/live-search-extended

为v12改进的后端搜索

安装量: 5,262

依赖项: 1

建议者: 0

安全性: 0

星标: 2

关注者: 2

分支: 0

开放问题: 0

类型:typo3-cms-extension

1.0.0 2023-09-05 05:52 UTC

This package is auto-updated.

Last update: 2024-09-05 09:31:48 UTC


README

TYPO3 12

Search result for EXT:news Search result for FE Users Search result for TS records Search result for EXT:form

此扩展改进了TYPO3后端右上角的搜索输出,被称为 实时搜索

  • 将记录的UID附加到标题中
  • 在结果中提供有关记录的更多信息
  • 搜索EXT:form记录

支持的TYPO3版本

  • 12.4 LTS

安装

composer require studiomitte/live-search-extended

用法

查看Configuration/TCA/Overrides/examples.php中的示例,这些示例默认启用,但在扩展设置中可以禁用。

配置此扩展有两种方式。每个配置都必须放在Configuration/TCA/Overrides/<some_file_name.php中。

由API驱动

$configuration = new \StudioMitte\LiveSearchExtended\Configuration\Table('tx_news_domain_model_news');
$configuration
    // Provide the field name and an icon identifier
    ->addField(
        (new \StudioMitte\LiveSearchExtended\Configuration\Field('datetime', 'actions-clock'))
            ->setSkipIfEmpty(true)
            ->setPrefixLabel(false)
    )
    ->addField(
        (new \StudioMitte\LiveSearchExtended\Configuration\Field('teaser', 'actions-document'))
            ->setSkipIfEmpty(true)
            ->setPrefixLabel(false)
    )
    ->persist();

直接在TCA中

$GLOBALS['TCA']['sys_category']['ctrl']['live_search_extended'] = [
    'fields' => [
        'parent' => [
            'icon' => 'mimetypes-x-sys_category',
        ],
    ],
];

扩展

您可以通过使用事件\StudioMitte\LiveSearchExtended\Event\ModifyRowEvent在结果行中提供计算字段。一个示例在\StudioMitte\LiveSearchExtended\EventListener\RowModification\SysTemplateRowModificationEventListener中,它提供TypoScript的行数到结果行,然后稍后被用于配置

$GLOBALS['TCA']['sys_template']['ctrl']['live_search_extended'] = [
    'fields' => [
        // _count_constants is a computed field
        '_count_constants' => [
            'icon' => 'form-number',
            // As the label can't be taken from TCA as the field is not there provided, a custom label can be set
            'label' => 'Count Constants',
            'skipIfEmpty' => false,
        ],
    ],
];

致谢

此扩展由Studio Mitte用♥创建。

查找更多我们开发的提供TYPO3网站额外功能的TYPO3扩展