# \<r:cycle\> explaination

**URL:** <https://www.ruby-forum.com/t/r-cycle-explaination/124394>\
**Category:** Radiant CMS\
**Created:** [December 28, 2007, 9:41am UTC](https://www.ruby-forum.com/t/r-cycle-explaination/124394 "2007-12-28T09:41:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nevin\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b77776/32.png) [@Nevin\_F](https://www.ruby-forum.com/u/Nevin_F)\
**Post date:** [December 28, 2007, 9:41am UTC](https://www.ruby-forum.com/t/r-cycle-explaination/124394/1 "2007-12-28T09:41:29Z")

</div>

I am trying to set up a page that will display one random embedded  
object (a  
youtube video) out of a pool of 30. That is to say, I want to have 30  
videos, and on each page load a video object will be chosen at random  
(or in  
order, so long as they change) and rendered. Can I do this somehow  
that’s  
not too round-about with \<r:cycle\>?

Thanks,

---

<div class="post-metadata">

**Author:** ![Nevin\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b77776/32.png) [@Nevin\_F](https://www.ruby-forum.com/u/Nevin_F)\
**Post date:** [December 28, 2007, 12:13pm UTC](https://www.ruby-forum.com/t/r-cycle-explaination/124394/2 "2007-12-28T12:13:42Z")

</div>

On 28/12/2007, Nevin F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am trying to set up a page that will display one random embedded object (a  
> youtube video) out of a pool of 30. That is to say, I want to have 30  
> videos, and on each page load a video object will be chosen at random (or in  
> order, so long as they change) and rendered. Can I do this somehow that’s  
> not too round-about with \<r:cycle\>?
> 
> ## Thanks,
> 
> Nevin

For random order use  
\<r:random\>  
\<r:option\>Choice 1\</r:option\>  
\<r:option\>Choice 2\</r:option\>  
\<r:random\>

Farrel
