后端预览 - 在 Fluidtemplate 中获取图像或 IRRE 数据
Backend Preview - get Image or IRRE data in Fluidtemplate
我在后端使用流体模板:mod.web_layout.tt_content.preview
是否可以从 FAL 获取图像或从该模板中的 IRRE 元素获取数据?
例如,前端有 TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
。那也可以用在后端吗?
您需要一个自定义 VH(IMO VHS 也提供这些)来获取数据。核心默认是不可能的。
我最近在 TYPO3\CMS\Backend\View\PageLayoutView
中使用钩子 PageLayoutViewDrawItem
来完成这项工作。这是最简单的方法。
正如 Georg Ringer 已经提到的,您可以使用 VHS ViewHelper 在流体预览模板中渲染预览图像 v:resource.record.fal
https://viewhelpers.fluidtypo3.org/fluidtypo3/vhs/5.0.1/Resource/Record/Fal.html
作为记录,我必须传递参数 _all
,因为我没有其他记录可用。
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
data-namespace-typo3-fluid="true">
<f:if condition="{assets}">
<v:content.resources.fal field="assets" as="images" record="{_all}">
<f:for each="{images}" as="image">
<f:if condition="{image}">
<f:image src="{image.id}" treatIdAsReference="1" width="100"/>
</f:if>
</f:for>
</v:content.resources.fal>
</f:if>
</html>
我在后端使用流体模板:mod.web_layout.tt_content.preview
是否可以从 FAL 获取图像或从该模板中的 IRRE 元素获取数据?
例如,前端有 TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
。那也可以用在后端吗?
您需要一个自定义 VH(IMO VHS 也提供这些)来获取数据。核心默认是不可能的。
我最近在 TYPO3\CMS\Backend\View\PageLayoutView
中使用钩子 PageLayoutViewDrawItem
来完成这项工作。这是最简单的方法。
正如 Georg Ringer 已经提到的,您可以使用 VHS ViewHelper 在流体预览模板中渲染预览图像 v:resource.record.fal
https://viewhelpers.fluidtypo3.org/fluidtypo3/vhs/5.0.1/Resource/Record/Fal.html
作为记录,我必须传递参数 _all
,因为我没有其他记录可用。
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers"
data-namespace-typo3-fluid="true">
<f:if condition="{assets}">
<v:content.resources.fal field="assets" as="images" record="{_all}">
<f:for each="{images}" as="image">
<f:if condition="{image}">
<f:image src="{image.id}" treatIdAsReference="1" width="100"/>
</f:if>
</f:for>
</v:content.resources.fal>
</f:if>
</html>