I am using a select field to upload a mp3 file:
track1File:
label: Mp3
type: select
options: audio
In my template:
<?= $page->track1File()?>
This just returns the filename, how do I get the full path to the file?
I am using a select field to upload a mp3 file:
track1File:
label: Mp3
type: select
options: audio
In my template:
<?= $page->track1File()?>
This just returns the filename, how do I get the full path to the file?
<?php
$audio = $page->track1File()->toFile();
if($audio): // this check is important before you can call any methods on the object, e.g. the url()
// do something with audio
endif;
thanks Texnixe, you’re a