Jump to content

Shuffle/splice of ActiveRecordIterator


Go to solution Solved by Daniel F,

Recommended Posts

Posted

I am using this code in several feed block templates to show a random entry from a selection of entries:

{{shuffle($records);}}
{{$records = array_slice($records, 0, 1);}}

But it doesn’t work for Commerce feed blocks, as $packages is not an array. Anyone knows how to adopt the above code to work with these ActiveRecordIterators?

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...