Hi —
What would be the best way to identify each file format within a page and place and display it with the correct tag.
ex: if it’s a MP4 file i want it to go into a or it’s a JPG I want it to go into a tag?
<?php foreach($page->files() as $item): ?>
<?php if($video = $item->file('JPG')): ?>
<img src="<?php echo $item->url() ?>">
<?php endif ?>
<?php if($image = $item->file('MP4')): ?>
<video width="320" height="240" "><source src="<?php echo $item->url() ?>" type="video/mp4"></video>
<?php endif ?>
<?php endforeach ?>
very thankful for any tips on this!
xx