déc
07
Cet article explique le fonctionnement de l’extension RandomImage qui permet d’afficher une image aléatoire dans une page.
Tout d’abord, il faut stocker les images dans un répertoire sous fileadmin, par exemple fileadmin/randomimages. Ensuite, il faut ajouter le code typoscript suivant :
includeLibs.tx_ccrandomimage = EXT:cc_random_image/pi1/class.tx_ccrandomimage_pi1.php
lib.imagerandom = USER_INT
lib.imagerandom {
userFunc = tx_ccrandomimage_pi1->main
path = fileadmin/randomimages/
fileExt = jpg,jpeg,gif,png
renderObj = IMAGE
renderObj {
file = ###FILE_1###
width = 500
height = 250
}
}

Télécharger l'extension RandomImage