Magento random block generator / block randomiser

This could be pretty useful if you want to combine XML block control with a random content display (eg. banner ads). Very easily achieved, simply create 1 file in ./base/default/template/page/html/random_block.phtml
 getSortedChildren();
  
  if(is_array($children)) {
    shuffle($children);
    echo $this->getChildHtml($children[0]); 
  }
 
 ?>
Then in your relevant XML file - control the output by using:

  
    240
    images/image1.png
    some alt text
    link url
  
  
    240
    images/image2.png
    some alt text
    link url
  

You can add any type of block you want and it will just grab one at random. [syntaxhighlighter]