Last active
March 13, 2017 18:49
-
-
Save BenjaminBeck/6584f5426a1d3ffbb18d to your computer and use it in GitHub Desktop.
ke_search Indexer for fluidcontent (2017: this is replaced by: https://github.com/BenjaminBeck/bdm_kesearchindexer_flux )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $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'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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(); | |
| } | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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; | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Together,
thanks for the feedback.
@stauer - i made a github repo and added your fix: https://github.com/BenjaminBeck/bdm_kesearchindexer_flux
thank you