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

时间:2018-12-08 05:32:42

标签: typo3 fluid

Page's Resources Tab

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

1 个答案:

答案 0 :(得分:1)

如果您的系统已安装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>

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

您也可以使用错别字解决方案,

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
}

通过以下方式呈现:

<f:cObject typoscriptObjectPath="lib.pageResources" />

您可以从此处获得更多相关信息:https://riptutorial.com/typo3/example/21734/image-and-image-resource

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

致谢