EXT:ke_search fluidcontent Indexer

This adds a new indexer configuration type to the ke_search extension.

With this configuration fluidcontent elements can be indexed.

Description ke_search Indexer for fluidcontent (2017: this is replaced by: https://github.com/BenjaminBeck/bdm_kesearchindexer_flux )
Author BenjaminBeck
Creation date 2015-03-21T13:59:32.000Z
Extensions
  1. FluidTYPO3.Fluidcontent
Tags
  1. Content
Files
  1. ext_localconf.php
  2. ext_tables.php
  3. RegisterIndexerFluidcontent.php
  4. TypesFluidcontent.php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['registerIndexerConfiguration'][] = 'BDM\\BdmThemeBootstrap\\Hooks\\KeSearch\\RegisterIndexerFluidcontent';
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['ke_search']['customIndexer'][] = 'BDM\\BdmThemeBootstrap\\Hooks\\KeSearch\\RegisterIndexerFluidcontent';
// enable:
$GLOBALS['TCA']['tx_kesearch_indexerconfig']['columns']['startingpoints_recursive']['displayCond'] .= ','.\BDM\BdmThemeBootstrap\Hooks\KeSearch\RegisterIndexerFluidcontent::$indexerType;
// disable:
$GLOBALS['TCA']['tx_kesearch_indexerconfig']['columns']['targetpid']['displayCond'] = ','.\BDM\BdmThemeBootstrap\Hooks\KeSearch\RegisterIndexerFluidcontent::$indexerType;
view raw ext_tables.php hosted with ❤ by GitHub
<?php
namespace BDM\BdmThemeBootstrap\Hooks\KeSearch;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
*
*/
class RegisterIndexerFluidcontent {
/**
* objectManager
*
* @var \TYPO3\CMS\Extbase\Object\ObjectManagerInterface
*/
public $objectManager;
/**
* Custom indexer for ke_search
*
* @param array $params
* @param array $pObj
*
* @return void.
* @author Benjamin Beck <[email protected]>
*/
public static $indexerType = 'fluidcontent';
function registerIndexerConfiguration (&$params, $pObj) {
// add item to "type" field
$newArray = array(
'Indexer for fluidcontent elements',
self::$indexerType,
\t3lib_extMgm::extRelPath( 'bdm_theme_bootstrap' ) . 'customnews-indexer-icon.gif'
);
$params['items'][] = $newArray;
}
/**
* Custom indexer for ke_search
*
* @param array $indexerConfig Configuration from TYPO3 Backend
* @param array $indexerObject Reference to indexer class.
*
* @return string Output.
* @author Benjamin Beck <[email protected]>
*/
public function customIndexer (&$indexerConfig, &$indexerObject) {
$this->objectManager = GeneralUtility::makeInstance( '\TYPO3\CMS\Extbase\Object\ObjectManager' );
// $custom_indexer = new \custom_indexer($indexerObject);
$indexer = $this->objectManager->get('\BDM\BdmThemeBootstrap\KeSearchIndexer\TypesFluidcontent', $indexerObject);
return $indexer->startIndexing();
}
}
<?php
namespace BDM\BdmThemeBootstrap\KeSearchIndexer;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
require_once ( ExtensionManagementUtility::extPath( 'ke_search' ).'Classes/indexer/types/class.tx_kesearch_indexer_types_tt_content.php');
class TypesFluidcontent extends \tx_kesearch_indexer_types_tt_content{
var $indexCTypes = array(
'fluidcontent_content'
);
public function getContentFromContentElement($ttContentRow) {
$flexform = $ttContentRow['pi_flexform'];
$flexform = strip_tags($flexform);
$flexform = html_entity_decode($flexform);
$flexform = strip_tags($flexform);
$flexform = preg_replace('/\s\s+/', ' ', $flexform);
$content = $ttContentRow['subheader'] . " " .$flexform;
$content .= parent::getContentFromContentElement($ttContentRow);
return $content;
}
}