# Can't shuffle structure collection

**URL:** <https://forum.getkirby.com/t/cant-shuffle-structure-collection/4540>\
**Category:** Questions\
**Tags:** v2\
**Created:** [June 28, 2016, 6:30am UTC](https://forum.getkirby.com/t/cant-shuffle-structure-collection/4540 "2016-06-28T06:30:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JagDogWeb](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/jagdogweb/32/953_2.png) [@JagDogWeb](https://forum.getkirby.com/u/JagDogWeb)\
**Post date:** [June 28, 2016, 6:30am UTC](https://forum.getkirby.com/t/cant-shuffle-structure-collection/4540/1 "2016-06-28T06:30:50Z")

</div>

Hey all,

I have this code here:

```
page('testimonials')->contentTestimonials()->toStructure()->shuffle()->first();

```

However using `shuffle()` doesn’t appear to work.

Any ideas?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [June 28, 2016, 6:38am UTC](https://forum.getkirby.com/t/cant-shuffle-structure-collection/4540/2 "2016-06-28T06:38:08Z")

</div>

Shuffle does not work with a structure collection, you would have to use `yaml()` and then shuffle the resulting array. See this post: [Pluck structured data?](https://forum.getkirby.com/t/pluck-structured-data/4482/4)

And here’s the [issue on GitHub](https://github.com/getkirby/kirby/issues/288).

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [July 12, 2016, 3:03pm UTC](https://forum.getkirby.com/t/cant-shuffle-structure-collection/4540/3 "2016-07-12T15:03:48Z")

</div>

Shuffling structure collections will finally work in Kirby 2.3.1. 🙂

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 4:57pm UTC](https://forum.getkirby.com/t/cant-shuffle-structure-collection/4540/4 "2025-02-06T16:57:33Z")

</div>

Archived on February 6, 2025, 4:57pm UTC


