->toPages() in multilevel structure

You have to loop through the structure like this:

<?php

$str = $site->header()->toStructure();
foreach($str as $item) {
  foreach($item->menu()->toStructure() as $menu) {
    dump($menu->links()->toPages());
  };
}
?>
1 Like