I am new to Kirby and trying to use a Structured field for the first time as shown here: Structure | Kirby CMS
I have using the ‘holidays’ example in my page from this above page but nothing is being output? Any help would be appreciated.
On my site/blueprint/pages/home page I have:
fields:
holidays:
type: structure
columns:
title:
width: 1/4
images:
width: 1/2
price:
width: 1/4
align: right
after: "USD"
fields:
title:
type: text
images:
type: files
description:
type: textarea
price:
type: number
On my site/templates/home.php page I have
<?php $items = $page->holidays()->toStructure();
foreach ($items as $item): ?>
<h2><?= $item->title()->html() ?></h2>
<?php foreach ($item->images()->toFiles() as $image): ?>
<img src="<?= $image->crop(400)->url() ?>">
<?php endforeach ?>
<p><?= $item->price() ?></p>
<?php endforeach ?>
Any help would be appreciated