‪TYPO3CMS  9.5
TYPO3\CMS\IndexedSearch\Example\PluginHook Class Reference

Public Member Functions

 initialize_postProc ()
 
array getDisplayResults_postProc (array $result)
 
 getResultRows ($sWArr)
 
array prepareResultRowTemplateData_postProc ($tmplContent, $row, $headerOnly)
 

Public Attributes

TYPO3 CMS IndexedSearch Controller SearchFormController $pObj
 

Detailed Description

Index search frontend example hook Index search frontend - EXAMPLE hook for alternative searching / display etc. Hooks are configured in ext_localconf.php as key => hook-reference pairs in $TYPO3_CONF_VARS['EXTCONF']['indexed_search']['pi1_hooks']. See example in ext_localconf.php for "indexed_search" Each hook must have an entry, the key must match the hook-key in class.tx_indexed_search.php and generally the key equals the function name in the hook object (a convension used)

just an example, not for public use, but used as a blue-print

Definition at line 26 of file PluginHook.php.

Member Function Documentation

◆ getDisplayResults_postProc()

array TYPO3\CMS\IndexedSearch\Example\PluginHook::getDisplayResults_postProc ( array  $result)

Example of how the content displayed in the result rows can be extended or modified before the data is assigned to the fluid template as {resultsets}. The code example replaces all occurrences of the search string with the replacement string in the description of all rows in the result.

Parameters
array$result
Returns
‪array

Definition at line 55 of file PluginHook.php.

◆ getResultRows()

TYPO3\CMS\IndexedSearch\Example\PluginHook::getResultRows (   $sWArr)

Providing an alternative search algorithm!

Parameters
array$sWArr‪Array of search words

Definition at line 70 of file PluginHook.php.

◆ initialize_postProc()

TYPO3\CMS\IndexedSearch\Example\PluginHook::initialize_postProc ( )

EXAMPLE of how you can post process the initialized values in the frontend plugin. The example reverses the order of elements in the ranking selector box. You can modify other values like this or add / remove items.

This hook is activated by this key / value pair in ext_localconf.php 'initialize_postProc' => \TYPO3\CMS\IndexedSearch\Example\PluginHook::class,

Definition at line 41 of file PluginHook.php.

◆ prepareResultRowTemplateData_postProc()

array TYPO3\CMS\IndexedSearch\Example\PluginHook::prepareResultRowTemplateData_postProc (   $tmplContent,
  $row,
  $headerOnly 
)

Example of how the content displayed in the result rows can be post processed before rendered into HTML. This example simply shows how the description field is wrapped in italics and the path is hidden by setting it blank.

Parameters
array$tmplContent‪Template Content (generated from result row) being processed.
array$row‪Result row
bool$headerOnly‪If set, the result row is a sub-row.
Returns
‪array Template Content returned.

Definition at line 83 of file PluginHook.php.

Member Data Documentation

◆ $pObj

TYPO3 CMS IndexedSearch Controller SearchFormController TYPO3\CMS\IndexedSearch\Example\PluginHook::$pObj

Is set to a reference to the parent object, "pi1/class.indexedsearch.php"

Definition at line 32 of file PluginHook.php.