如何在 Fluid Typo3 中访问页面的资源文件

San*_*tau 2 typo3 fluid

页面的资源选项卡

我一直在尝试访问这些文件,但没有运气。任何帮助表示赞赏。

GNB*_*GNB 7

如果您的系统安装了 EXT:vhs,您可以像这样通过 vhs viewhelper 获得它,

{namespace v=FluidTYPO3\Vhs\ViewHelpers}

<v:page.resources.fal table="pages" field="media" uid="{page.uid}" as="images" slide="-1" >
    <f:for each="{images}" as="image">
        <f:image src="{image.url}" alt="{image.alternative} {image.name}" title="{image.title}" />
    </f:for>
</v:page.resources.fal>
Run Code Online (Sandbox Code Playgroud)

您可以从这里获得更多相关信息:https : //github.com/FluidTYPO3/vhs/pull/395https://fluidtypo3.org/viewhelpers/vhs/2.3.3/Page/Resources/FalViewHelper.html#argument -滑动

您也可以使用typoscrpt解决方案,

lib.pageResources = FILES 
lib.pageResources { 
    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 = 3
}
Run Code Online (Sandbox Code Playgroud)

渲染这个:

<f:cObject typoscriptObjectPath="lib.pageResources" />
Run Code Online (Sandbox Code Playgroud)

您可以从这里获得更多信息:https : //riptutorial.com/typo3/example/21734/image-and-image-resource

希望这对您有所帮助... #KeepCoding .. ;)

问候