28 Apr

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 <?php $children = $this->getSortedChildren(); if(is_array($children)) { shuffle($children); echo $this->getChildHtml($children[0]); } … Continue reading