Random image - shuffle

Author Message

Niklas Gunnäs

Thursday 21 April 2005 5:26:57 am

I have installed the shuffle operator and it works when I test it with this code in pagelayout.tpl

{let randomised_array=fetch('content','tree', hash('parent_node_id', '177'))|shuffle}
{section name=random loop=$randomised_array}
{$:item.name} -- testing</br>
{/section}
{/let}

What I want to do is to show random images from Media library/images.

Xavier Dutoit

Thursday 21 April 2005 9:42:40 am

Hi,

Have you tried with the parent_node_id set to 51 (media/images) ?

then use an embed view (by default, it displays the image.

X+

http://www.sydesy.com

Niklas Gunnäs

Friday 22 April 2005 3:18:35 am

This code shows random image from folder 73. If I change it to 51 it shows nothing. Why?

{let randomised_array=fetch('content','tree', hash('parent_node_id', '73',
						class_filter_type, "include", class_filter_array, array(5)))|shuffle}
{section name=random loop=$randomised_array max=1}
<img src={$random:item.object.data_map.image.content[medium].full_path|ezroot} border="0">
{/section}
{/let}	

Felix Laate

Friday 22 April 2005 4:24:35 am

Hi Niklas!

Permission issue? Anonymous users need "read" permission to the media section (or at least the folders where your images are)

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Niklas Gunnäs

Friday 22 April 2005 5:37:52 am

Thanks Felix

You made my day....

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.