Issue rendering files section

Hello,
I can’t render my files section in the site.

Here’s the the blueprint for the page and the rendering markdown.

sections:
  news:
    headline: News
    type: files
    empty: No news yet
    layout: cards
    size: tiny
    template: new
    image:
      cover: true
      ratio: 1/1

<?php $images = $page->news()->toFiles(); foreach($images as $image): ?>
<img src="<?= $image->url() ?>" alt="">
<?php endforeach ?>

I can’t figure what I’m doing wrong…
Thanks

You cannot access the files in a files section like field content, because a section (unlike a field) doesn’t store anything in the content file. The way to grab images from a section is via their file template:

<?php
$images = $page->images()->template('new');
foreach($images as $image): ?>
  <img src="<?= $image->url() ?>" alt="">
<?php endforeach ?>

Thanks a lot, as always!