打字稿9.5渲染文件对象,如Contentelement

时间:2020-02-18 09:10:49

标签: typo3 typoscript typo3-9.x

我通过CONTENT从页面中获取一个元素,并希望像从页面中的所有其他图像一样从中渲染图像。 我已经安装了用于响应图像的短信,但是当我通过打字稿渲染此图像时,将输出正常的<img>。 我如何更改我的打字稿以使其像部分文件Media / Rendering / Image中那样呈现?

                            20 = FILES
                            20{
                                references {
                                    table = tt_content
                                    fieldName = image
                                    uid.data = field:uid
                                }
                                begin = 0
                                maxItems = 1
                                renderObj = IMAGE
                                renderObj {
                                    file.import.data = file:current:publicUrl
                                    file.width = 1920c
                                    file.treatIdAsReference = 1
                                    stdWrap.outerWrap = |
                                }
                            }

非常感谢您!

1 个答案:

答案 0 :(得分:0)

由于您提到的示例是在Fluid中渲染的,因此建议您也使用Fluid。用于响应式图像的ViewHelper在Fluid中使用。 尝试摆脱通过TypoScript进行渲染并使用Fluid模板的情况。

相关问题