Extbase 6.2: Import Image into FAL

538 views Asked by At

I am wondering what's the best solution to get my problem solved.

I have a folder with zip files containing images and want to import the images into my extension. In a perfect world I want to do this using FAL and not manually - is there a way to do it?

Thanks a lot, your help is really appreciated.

1

There are 1 answers

3
nbar On

You could upload your images to the Public folder of your extension or to fileadmin and then use VHS View Helper to get the images in your extension with v:media.files https://fluidtypo3.org/viewhelpers/vhs/master/Media/FilesViewHelper.html

Then use a for loop: https://fluidtypo3.org/viewhelpers/fluid/master/ForViewHelper.html

and the f:image: https://fluidtypo3.org/viewhelpers/fluid/master/ImageViewHelper.html

This should look something like this:

<f:alias map="{myimages: {v:media.files(path: 'EXT:myext/Resources/Public/myimages', extensionList: '''', prependPath: 1, order: '''', excludePattern: '''')}">
    <f:for each="{myimages}" as="myimage">
        <f:image src="{myimage}" alt="alt text" />
    </f:for>
</f:alias>