Hi I am trying to get an image URL from the home page and use it on some of the pages of my website. I am getting no errors, but also no image with this method. I have used this to get the text which works fine: <?= page('home')->packageSectionTitle() ?>
Why does this not work for images?
<div class="package-image" style="background-image:url(<?=($site = page('home')->package1IMG()->toFile()) ? $site->url() : ''; ?>" alt="<?=($site = page('home')->package1IMG())?>">