Display notes from a .php template

Hi there,

Using a modified version of kirby’s starterkit, I would like to display the “notes” as a blog grid in this page : YAËL BENAYOUN, consultante et chercheuse indépendante
 en sciences sociales

But I do note know how to call them with php.

For now the code is the following, can you please help me to modify it in order to display the notes instead of the “productions” subpages ?

Many thanks !

<ul class="grid" style="--gutter: 1.5rem">
  <?php foreach ($page->children()->listed() as $note): ?>
  <li class="column" style="--columns: 3">
    <a href="<?= $note->url() ?>">
      <figure>
        <span class="img" style="--w:4;--h:4">
          <?php if ($cover = $note->cover()): ?>
            <img src="<?= $cover->crop(400, 400)->url() ?>" alt="<?= $cover->alt()->esc() ?>">
          <?php endif ?>
        </span>
        <figcaption class="img-caption">
          <?= $note->title()->esc() ?>
        </figcaption>
      </figure>
    </a>
  </li>
  <?php endforeach ?>
</ul>

To get the children of the notes page instead of the children of the current page


This will fail though if the notes page is ever deleted or renamed, so it would make sense to wrap this in an if statement of the page exists:

<?php if ($p = page('notes'): ?>
  <?php foreach ($p->children()->listed() as $note): ?>
     <!-- rest of code -->
  <?php endforeach ?>
<?php endif ?>