Monday 08 January 2007 3:33:53 pm
I used following code in a site to get random images from "Media / Images / Sponsor Images" (the folder "Sponsor Images" has id 93):
{let randomised_array=fetch('content','tree', hash('parent_node_id', '93', class_filter_type, "include", class_filter_array, array(5)))|shuffle}
{section name=random loop=$randomised_array max=3}
<div class="side"><a href="{$random:item.data_map.image_url.content}"><img src={$random:item.object.data_map.image.content[banner125].full_path|ezroot} /></a></div>
{/section}
{/let}
It worked for me after giving anonymous access to the media folder, like I said before. In theory this code should work with other content classes if you change the class_filter array.
eZ Partner in Madrid (Spain)
Web: http://www.atela.net/
|