Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access Page's Resources files in Fluid Typo3

Tags:

typo3

fluid

Page's Resources Tab

I have been trying to access these files but with no luck. Any help is appreciated.

like image 502
Santiago Degetau Avatar asked Oct 31 '25 05:10

Santiago Degetau


1 Answers

If your system has EXT:vhs installed you can get this via vhs viewhelper like this,

{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>

you can get more about this from here: https://github.com/FluidTYPO3/vhs/pull/395 and https://fluidtypo3.org/viewhelpers/vhs/2.3.3/Page/Resources/FalViewHelper.html#argument-slide

You can use typoscrpt solution as well,

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
}

Render this with:

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

You can get more about this from here: https://riptutorial.com/typo3/example/21734/image-and-image-resource

Hope this helps you... #KeepCoding.. ;)

Regards

like image 62
Geee Avatar answered Nov 02 '25 22:11

Geee