[TYPO3-english] Placing Multiple Images from a Directory into Multiple Locations

Scotty C superscotty19 at yahoo.com
Wed Aug 21 06:15:49 CEST 2013


Hi everyone,

This one is weird. I have a request to:
- Grab 2 images from a directory. They cannot be the same image
- Put image 1 into an <img id="image1"> tag using getelementbyid or put it into a subpart called "image1"
- Put image 2 into an <img id="image2"> tag using getelementbyid or put it into a subpart called "image2"

It's a simple enough algorithm but the problems are:
- I can't use PHP to place the image - that's best suited for Javascript
- I can't use Javascript to grab the images - that's PHP
- Most importantly, I don't know TYPOscript well enough to know if it can do this


My current code is very simple: grab an image from a directory, put it into a subpart:
page.19.subparts.IMAGE1 = COA_INT
page.19.subparts.IMAGE1 {
   10 = IMAGE
   10.file.import {
      filelist = fileadmin/images/|jpg,png,gif|ext|r|1
      listNum = rand
   }
}

... This works fine, but if I repeat the code for IMAGE2, there's no chance I will get an image that is not 100% different from image1.

Help? (thanks)
-Scott.


More information about the TYPO3-english mailing list