Skip to content

Rotating Asset List

<template:if $templateConstants['isPublishing']><?php echo '<?php $list = ' . var_export($list, true) . '; ?>'; ?></template:if>
<template:code>
<?php
$rand = array_rand($list['items']);
$item = $list['items'][$rand];
//printA($item);
$assetManager = getStaticClass('AssetManager');
$path = $assetManager->getPathFromStruct($item,'web',$item['primarySiteId'], isPublishing());
$item['path'] = substr($path, 1, strlen($path));
?>
<img src="##$path##" alt="##$item['altText']##" />
</template:code>
Author
D. Butler
Date Written:
May, 2008
Version:
1
Time:
.5 hours
Department(s):
Production

Sites using this template:

Comments: