0
"media"フィールドを持つカスタムコンテンツエレメントを作成しました。ここでTYPO3:データ処理でカスタムCEのファイル/メディアを取得
は私のデータプロセッサクラスです:
class CustomCeProcessor implements DataProcessorInterface
{
/**
* Process data for the content element "My new content element"
*
* @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
)
{
$processedData['foo'] = 'This variable will be passed to Fluid';
return $processedData;
}
}
$ processedDataは、すべてのフィールドの値が含まれている「メディアフィールド」ウィッヒは空の配列です期待しています。私は流体にそれを渡すためにDataProcessでメディアファイルにアクセスするにはどうすればよい
$GLOBALS['TCA']['tt_content']['types']['custom_ce'] = [
'showitem' => '
--palette--;' . $frontendLanguageFilePrefix . 'palette.general;general,
--linebreak--, header;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:header_formlabel,
--linebreak--, date;Datum,
--linebreak--, media;Media,
--linebreak--, bodytext;txt,
'
];
:ここ
は私のTCAがどのように見えるかですか?
この指示に従っていますか?いいえ、見てください:https://usetypo3.com/custom-fsc-element.html –
はい私はこのチュートリアルを使ってカスタムフォームを作成しました。 tt_contentテーブルのinternal_type "file"のカスタム "my_pdf"フィールドを追加しました。私のsetup.txtでは、チュートリアルのようにFilesProcessorのreferences.fieldName = my_pdfを設定しました。しかし、$ processedData ['files']はCustomCeProcessorクラスでは空です。 – user6800816