Friday 27 February 2004 3:43:28 am
Thanks for the reply, Bård! However, I still have some trouble regarding this.
In some sites I use random images. For instance, on a front page I want the main image to be randomly selected from a group of five images.
I now manage this in the following way:
1. I make a fetch from the folder where the images exist and run a "shuffle" operator on the resulting array. 2. I get the first image in the array and show it on the page.
This works if I place cache-block around the image, like in the code below:
---------------------------
{cache-block keys=array('random_image_frontpage',$image:item.node_id)}
<td valign="top" width="{$image:item.contentobject_version_object.data_map.image.content[large].width}" height="{$image:item.contentobject_version_object.data_map.image.content[large].height}">{attribute_view_gui attribute=$image:item.contentobject_version_object.data_map.image image_class="large"}</td>
{/cache-block} ---------------------------- However - when I activate viewcache, I get the same image on every page load. Am I doing something stupid? In that case I would appreciate some guidance.
Kind regards Nicklas Lundgren
|