我正在尝试将页面资源媒体图像添加到 TYPO3 v10 中的 MenuAbstract.html 模板。它只是行不通。我没有得到任何输出。我尝试将以下内容添加到流体模板中:
<f:cObject typoscriptObjectPath="lib.pageImage" />
整个模板看起来像这样:
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="Main">
<f:if condition="{menu}">
<ul>
<f:for each="{menu}" as="page">
<li>
<a href="{page.link}"{f:if(condition: page.target, then: ' target="{page.target}"')} title="{page.title}">
<span>{page.title}</span>
</a>
<f:cObject typoscriptObjectPath="lib.pageImage" />
<f:if condition="{page.data.resource}">
<f:format.html>{page.data.media}</f:format.html>
</f:if>
<f:if condition="{page.data.abstract}">
<f:format.html>{page.data.abstract}</f:format.html>
</f:if>
</li>
</f:for>
</ul>
</f:if>
</f:section>
</html>
TypoScript 对象如下所示:
lib.pageImage = FILES
lib.pageImage {
references {
table = pages
uid.data = uid
fieldName = media
}
renderObj = IMAGE
renderObj {
file {
import.data = file:current:uid
treatIdAsReference = 1
width = 150c
height = 150c
}
altText.data = file:current:alternative
titleText.data = file:current:title
}
maxItems = 1
}
请帮忙。