‪TYPO3CMS  ‪main
TYPO3\CMS\Frontend\DataProcessing\SplitProcessor Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\DataProcessing\SplitProcessor:
TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface

Public Member Functions

array process (ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
 

Detailed Description

This data processor can be used for processing data for the content elements which have split contents in one field like e.g. "bullets". It will split the field data in an array ready to be iterated over in Fluid.

Example field data:

This is bullet 1, This is bullet 2, This is bullet 3

Example TypoScript configuration:

10 = TYPO3\CMS\Frontend\DataProcessing\SplitProcessor 10 { if.isTrue.field = bodytext delimiter = , fieldName = bodytext removeEmptyEntries = 1 filterIntegers = 1 filterUnique = 1 as = bullets }

whereas "bullets" can be used as a variable {bullets} inside Fluid for iteration.

Definition at line 45 of file SplitProcessor.php.

Member Function Documentation

◆ process()

array TYPO3\CMS\Frontend\DataProcessing\SplitProcessor::process ( ContentObjectRenderer  $cObj,
array  $contentObjectConfiguration,
array  $processorConfiguration,
array  $processedData 
)

Process field data to split in an array

Parameters
ContentObjectRenderer$cObj‪The data of the content element or page
array$contentObjectConfiguration‪The configuration of Content Object
array$processorConfiguration‪The configuration of this processor
array$processedData‪Key/value store of processed data (e.g. to be passed to a Fluid View)
Returns
‪array the processed data as key/value store

Implements TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface.

Definition at line 56 of file SplitProcessor.php.

References TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\checkIf(), TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrapValue(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().