Typo3:使用目录中的 ViewHelper 加载 HTML 文件

Typo3: Load HTML File with ViewHelper from Directory

我在 typo3 fileadmin 中有几个目录,我想在我的代码中的某些点从中加载某些文件类型。此文件夹中包含图像、音频文件和 HTML 文件等文件。使用 for 循环,我遍历文件并根据文件类型 (https://blog.pixel-ink.de/dateitypen-fal/) 呈现文件。它适用于图像和其他媒体文件,但我无法正确显示 HTML-File。这是我得到的:

<f:for each="{mkk:getFilesInFolder(dir:'/stories/test1/')}" as="file">
   <f:if condition="{file.properties.type} == 1">
      <f:format.html>{file}</f:format.html>
   </f:if>
</f:for>

HTML-文件在 {file} 变量中,但我真的不知道如何从中提取原始 HTML 文本。我也确实检查了 format.html (https://docs.typo3.org/other/typo3/view-helper-reference/9.5/en-us/typo3/fluid/latest/Format/Html.html) 的 typo3 文档,但这也没有帮助。有什么建议吗?

供参考:HTML-文件只包含一个文章标签,有很多段落。这里还有输出图像的 for 循环,效果很好:

<f:for each="{mkk:getFilesInFolder(dir:'/stories/test1/')}" as="file">
   <f:if condition="{file.properties.type} == 2">
      <f:image image="{file}" class="story-diashow-img" />
  </f:if>
</f:for>

你可以使用{file.contents -> f:format.raw()}