私はそれを機能させるために一生懸命努力し、カスタム DataProcessor を使用しました。カスタム DataProcessors の詳細については、https ://docs.typo3.org/typo3cms/extensions/fluid_styled_content/7.6/AddingYourOwnContentElements/Index.html#data-processor をご覧ください。
これはプロセッサ自体です。
/**
* @param ContentObjectRenderer $cObj The data of the content element or page
* @param array $contentObjectConfiguration The configuration of Content Object
* @param array $processorConfiguration The configuration of this processor
* @param array $processedData Key/value store of processed data (e.g. to be passed to a Fluid View)
* @return array the processed data as key/value store
*/
public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
{
$table = $processorConfiguration['references.']['table'];
$fieldName = $processorConfiguration['references.']['fieldName'];
$irreElements = $cObj->getRecords(
$table,
[
'where' => $fieldName.'='.$cObj->data['uid'],
'orderBy' => 'sorting'
]
);
$targetVariableName = $cObj->stdWrapValue('as', $processorConfiguration);
$processedData[$targetVariableName] = $irreElements;
return $processedData;
}
これがTypoScriptの設定です
tt_content {
services < lib.fluidContent
services {
templateName = Services.html
dataProcessing {
23 = Vendor\ExtensionName\DataProcessing\WhateverYouWantToCallItProcessor
23 {
references.fieldName = service
references.table = tt_content
as = serviceElements
}
}
}
}