0

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.

lufi
  • 610
  • 7
  • 29

1 Answers1

0

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>
nbar
  • 6,028
  • 2
  • 24
  • 65
  • That's pretty cool idea. Just one more thing i didn't get: how do I get the images into my extension if I want to create one entry per image? – lufi Jun 12 '15 at 21:56
  • @lufi what do you mean with one entry? – nbar Jun 12 '15 at 21:58
  • sorry. :-) I have a extension and I one table where I want to store image information. So if there are for example 10 images included in the uploaded zip, each image should get one database entry. The tasks of the import process needs to be: 1. extract the zip file 2. "import" the extracted images into database 3. delete the zip file. And one more challenge could be not to import files already imported. – lufi Jun 12 '15 at 22:10