TYPO3 ke_search custom don't index for accordions & all elements from bootstrap_package)?

55 Views Asked by At

ke_search extension don't index my accordion content element. Anyone have found a solution for this ?

TYPO3 v12 Bootstrap_package Accordion C.E. ke_search v5.1.2

2

There are 2 best solutions below

0
On BEST ANSWER

I have found this solution that worked for my issue:

  • Installed ke_search_hooks 5.0.0
  • Change source code accordingly in those two php files:

file AdditonaResultMarker.php

public function additionalResultMarker(array &$tempMarkerArray, array $row, ResultlistPlugin $resultListPlugin)
    {
        if ($row['type'] == 'accordion') {
            /** @var ConnectionPool $connectionPool */
            $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
            $queryBuilder = $connectionPool->getQueryBuilderForTable('tx_bootstrappackage_accordion_item');
            $newsRecord = $queryBuilder
                ->select('header')
                ->from('tx_bootstrappackage_accordion_item')
                ->where(
                    $queryBuilder->expr()->like('uid', $queryBuilder->createNamedParameter($row['orig_uid'], \PDO::PARAM_INT))
                )
                ->execute()
                ->fetch(FetchMode::ASSOCIATIVE);
            if ($newsRecord) {
                $tempMarkerArray['header'] = $newsRecord['header'];
            }
        }
    }

file ExampleIndexer.php

                $tags = '';

            if (isset($record['datetime'])) {
                $datetime = $record['datetime'];
            } else {
                $datetime = 0;
            }

            if (isset($record['fe_group'])) {
                $datetime = $record['fe_group'];
            } else {
                $fe_group = null;
            }

This worked for me, i hope this will help someone else.

0
On

Since ke_search 5.3.0 it is possible to add additional tables which hold content from e.g. EXT:bootstrap_package or EXT:mask, see

https://docs.typo3.org/p/tpwd/ke_search/5.3/en-us/Indexing/IndexerTypes/Pages.html#index-content-from-additional-tables-eg-ext-mask-ext-bootstrap-package