简体   繁体   English

TYPO3 内联记录预览图

[英]TYPO3 preview image of inline records

A tt_content custom content element (imageslider) has IRRE slides. tt_content 自定义内容元素 (imageslider) 具有 IRRE 幻灯片。

The slide record has a title and an image (filereference).幻灯片记录有一个标题和一个图像(文件参考)。

Is it possible to preview the image of the IRRE record?是否可以预览 IRRE 记录的图像?

The previewRenderer class seems to be oriented only on the page view. previewRenderer class 似乎只面向页面视图。

typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php shows a TCA setting for headerThumbnail typo3/sysext/backend/Classes/Form/Container/InlineRecordContainer.php显示 headerThumbnail 的 TCA 设置

However this TCA doesn't produce the headerThumbnail.但是,此 TCA 不会生成 headerThumbnail。

'appearance' => [
    'headerThumbnail' => [
        'field' => 'image',
        'width' => '45',
        'height' => '45c',
    ],

So a userFunc or something is needed to retrieve the fileUid for field ?所以需要一个 userFunc 或其他东西来检索field的 fileUid 吗? Or is there an easier solution possible?或者是否有更简单的解决方案?

Nice hint, that there should be custom thumbnails possible...很好的提示,应该有可能的自定义缩略图......

After diving a bit deeper in InlineRecordContainer , it seems to be clear, that this can't work (anymore?).在深入InlineRecordContainer之后,似乎很清楚,这行不通(再也行不通了?)。 There are (in v10/v11) the following lines: (在 v10/v11 中)有以下几行:

// Renders a thumbnail for the header
if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails'] && !empty($inlineConfig['appearance']['headerThumbnail']['field'])) {
    $fieldValue = $rec[$inlineConfig['appearance']['headerThumbnail']['field']];
    $fileUid = $fieldValue[0]['uid'];

For the UID of the thumbnail, the first array entry in the given field is used.对于缩略图的 UID,使用给定字段中的第一个数组条目。 But when debugging $rec (= $data['databaseRow'] ), we see, it is just the raw record, which means a FAL-field will not be an array but only an integer that counts the relations...但是在调试$rec (= $data['databaseRow'] ) 时,我们看到,它只是原始记录,这意味着 FAL 字段将不是一个数组,而只是一个 integer 计算关系...

IMO this is a bug. IMO 这是一个错误。 I have just reported it: https://forge.typo3.org/issues/96188我刚刚报了: https://forge.typo3.org/issues/96188

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM