I am trying to access image files on a page from it’s corresponding subpage but I am coming up with an error I can’t figure out
<?php foreach ($page->children()->listed() as $project): ?>
<li>
<div class="project-placeholder">
<img class="" src="<?= $project->mobilethumbnail()->toFile()->url() ?>" alt="<?= $project->alt() ?>"
srcset="<?= $project->mobilethumbnail()->toFile()->srcset([300, 800, 1024, 1400]) ?>" />
</div>
</li>
<?php endforeach ?>
Blueprint:
content:
type: fields
fields:
mobilethumbnail:
type: files
max: 1
label: Mobile Thumbnail Placeholder