Displaying certain number of items from a structure field

Hi all

Is there a way to display only a certain number of items from a structure field?

In this scenario I want to display the first 6 items as ‘cards’ and the rest of items in a list view. So I would like to pretty much be able to say display first six items, and then have another ‘to structure’ displaying items 7 and beyond.

You can use limit() and offset()

$items = $page->fieldname()->toStructure();
$cards = $items->limit(6);
$list  = $items->offset(6);
1 Like