Skip to content

studiomitte/live-search-extended

Repository files navigation

TYPO3 Extension live_search_extended

TYPO3 12

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

This extension improves the output of TYPO3's backend search of the top right corner which is called Live Search by:

  • Appending the UID of the record to the title
  • Provide more information about the record in the result
  • Search for EXT:form records

Supported TYPO3 versions:

  • 12.4 LTS

Installation

composer require studiomitte/live-search-extended

Usage

Check out the examples in Configuration/TCA/Overrides/examples.php which are enabled by default but can be disabled in the Extension settings.

There are 2 ways to configure the extension. Every configuration must be placed in Configuration/TCA/Overrides/<some_file_name.php.

API driven

$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();

Directly in TCA

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

Extending

You can provide computed fields in the result row by using the event \StudioMitte\LiveSearchExtended\Event\ModifyRowEvent. One example is in \StudioMitte\LiveSearchExtended\EventListener\RowModification\SysTemplateRowModificationEventListener which provides the line count of TypoScript to the result row which is then later used in the configuration

$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,
        ],
    ],
];

Credits

This extension was created by Studio Mitte with ♥.

Find more TYPO3 extensions we have developed that provide additional features for TYPO3 sites.

About

Improve results of Live Search in TYPO3 v12 backend

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages