Hi,
in the panel i get the error “Invalid field type (“image”)” when I use the toStructure()-method with a image.
Kirby Version 3.1.2
Panel:
Blueprint:
itemcontenttext:
label: Content Text List
type: structure
fields:
itemimage:
label: Image
type: image
itemtitle:
label: Title
type: text
itemtext:
label: Text
type: text
itemurl:
label: URL
type: url
Code:
<?php foreach ($page->itemcontenttext()->toStructure() as $item): ?>
<div class="row">
<div class="col-md-12 col-lg-5">
<div class="info-content">
<h4><?= $item->itemtitle() ?></h4>
<p><?= $item->itemtext() ?></p>
</div>
<?php if ($item->itemurl()->isNotEmpty()): ?>
<a href="<?= $item->itemurl() ?>" class="btn btn-default-yellow-fill mt-3" data-i18n="[html]global.go"></a>
<?php endif ?>
</div>
<?php if($image = $item->itemimage()->toFile()): ?>
<div class="col-md-12 col-lg-6 offset-lg-1 backups anima wow animated fadeInUp fast second">
<img class="svg" src="<?php echo $image->resize(800, null, 80)->url() ?>" alt="<?= $item->itemtitle() ?>">
</div>
<?php endif ?>
</div>
<hr>
<?php endforeach ?>
Hope someone had the same issue and came up with an answer.
Thank you