Index: typo3/sysext/cms/tslib/class.tslib_content.php =================================================================== --- typo3/sysext/cms/tslib/class.tslib_content.php (revision 5732) +++ typo3/sysext/cms/tslib/class.tslib_content.php (working copy) @@ -604,6 +604,9 @@ case 'MULTIMEDIA': $content.=$this->MULTIMEDIA($conf); break; + case 'RANDOM': + $content.=$this->RANDOM($conf); + break; default: // call hook functions for extra processing if($name && is_array($TYPO3_CONF_VARS['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault'])) { @@ -2625,6 +2628,22 @@ return $content; } + + /** + * Rendering the cObject, RANDOM + * + * @param array Array of TypoScript properties + * @return string Output + */ + function RANDOM($conf) { + $content = ''; + if (is_array($conf)) { + $sortedKeyArray = t3lib_TStemplate::sortedKeyList($conf); + $key = $sortedKeyArray[array_rand($sortedKeyArray)]; + $content = $this->cObjGetSingle($conf[$key], $conf[$key.'.'], 'random_'.$key); // Get the contentObject + } + return $content; + }