studiomitte / live-search-extended
为v12改进的后端搜索
1.0.0
2023-09-05 05:52 UTC
Requires
- typo3/cms-core: ^12.4
README
此扩展改进了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用♥创建。