Hi there, I’m currently trying to call an image url from a subpage onto the homepage using the following code.
<div <?php echo 'id="collapse'.$k.'"' ?> class="panel-collapse collapse" role="tabpanel" <?php echo 'aria-labelledby="heading'.$k.'"' ?>>
<div class="panel-body">
<?php foreach ($item->children() as $subitem):
$image = $subitem->preview()->toFiles();
?>
<a class="sub-item" href="<?= $subitem->url() ?>">
<?= $subitem->title()->kt() ?></a>
<img src="<?= $subitem->preview()->url() ?>">
<?php endforeach ?>
</div>
</div>
</div>
However doing so only outputs the file name as “—6.jpg” adding in a dash. How can I get this to work properly? and using $image->url() outputs nothing.