[TYPO3-english] Random DAM image with TS problem

Krystian Szymukowicz t33k.RE.MO.VE at RE.MO.VE.prolabium.com
Sat Jun 13 14:58:21 CEST 2009


Christian Hennecke wrote:
> Hello,
> 
> I need to select a random image from the DAM and obtain both image file 
> path and title for later use. This works by using a CONTENT object.
> 
> Now the problem is that I need the *same* randomly selected file several
> times. When I use the above TS code for file.import.cObject, a *new* 
> file is selected every time:
> 
> 10 = IMAGE
> 10 {
>   file.import.cObject < temp.randomImageFile
>   altText.data = register:randomImageDamTitle
> }
> 20 = IMAGE
> 20 {
>   file.import.cObject < temp.randomImageFile
>   offset = 250,0
>   altText.data = register:randomImageDamTitle
> }
> 
> Any idea how to do the selection only once? I guess I don't see the 
> forest for the trees here...

I am not sure if this will work but can you try what will happen if you 
make the following?

10 = LOAD_REGISTER
10.myImage.cObject = IMAGE
10.myImage.cObject {
    file.import.cObject < temp.randomImageFile
    altText.data = register:randomImageDamTitle
}

20 = TEXT
20.data = register:myImage


--
grtz
Krystian Szymukowicz


More information about the TYPO3-english mailing list