Hi all - I’m am looping files added by the file field type, and hoping to fetch the sort number of the file so I can use it for an animation delay variable as shown in the markup below (data-aos-delay=“<?= $logo->id()?>00”). This helps me create a sequenced fade in effect. When using files added via a structured item I can use the ‘id’ but when they are just files I have tried various options and can’t get anything. Is there a way this can be done or do the files need to be added to as structured items to do this?
Blueprint:
supplierLogos:
type: files
layout: cards
Markup:
<?php
$logos = $site->supplierLogos()->toFiles();
foreach($logos as $logo): ?>
<div class="d-flex aos-init aos-animate" data-aos-delay="<?= $logo->id()?>00" data-aos="fade-in">
<img src="<?= $logo->url() ?>" alt="" class="img-fluid">
</div>
<?php endforeach ?>
Thanks