Access nested foreach with toStructure()

i cant test it right now, but texnixe posted the following code a while back: It looks quite similar to what you are trying to archive. Btw. i am becoming hungry, menu looks very tasty :wink:

<table>
  <?php foreach($page->training()->toStructure() as $item): ?>
  <?php $count = count($item) ?>
    <tr>
      <?php foreach($item as $key => $detail): ?>
        <td><?= $detail ?></td>
      <?php endforeach ?>
    </tr>
  <?php endforeach ?>
 </table>

Unfortunately the documentation is limited to not nested yaml / structured field, since nesting structured fields in the panel is not possible:

https://getkirby.com/docs/cookbook/structured-field-content

1 Like