Here is one approach:
http://modxcms.com/forums/index.php/topic,34509.msg209809.html#msg209809
Name Snippet: RandomPics and use [!RandomPics!]
<?php
$pics = $modx->getChunk('Pics');
$picsArray = explode('#',$pics);
$rand_keys = array_rand($picsArray);
return $picsArray[$rand_keys];
?>
Name Chunk: Pics
<img src="assets/images/foo.jpg" alt="">#
<img src="assets/images/foo2.jpg" alt="">#
<img src="assets/images/foo3.jpg" alt="">#
<img src="assets/images/foo4.jpg" alt="">#
//Chunks ->
http://modxcms.com/forums/index.php/topic,31550.msg191664.html#msg191664
Hi mrhaw
So to get this to work I have to create both a snippet and a chunk, and then set the snippet to "call" my specified chunk?
But if I would like to have som text displayed as mentioned earlier, how would I go about this using this code:
<img src="assets/images/foo.jpg" alt="">#
<img src="assets/images/foo2.jpg" alt="">#
<img src="assets/images/foo3.jpg" alt="">#
<img src="assets/images/foo4.jpg" alt="">#
´Cause all this does is getting images from a specified folder within my assets.
I would like to be able to add some text in some sort of dynamic way, so that I don´t have to put the text on each picture when it is saved in photoshop.
//Carsten
You don