Hi,
I’m using Kirby to set up a webcomic site, and I’m running into an issue when trying to get the image files that are defined in my blueprint:
title: Comic
icon: 🖼
status:
draft: true
listed: true
columns:
# main content
main:
width: 1/3
sections:
thumbnail:
type: files
headline: Thumbnail
template: thumbnail-image
min: 0
max: 1
image:
cover: true
mainimage:
type: files
headline: Main horizontal image
template: main-image
min: 1
max: 1
image:
cover: true
midimage:
type: files
headline: Mid-sized image (for tablets)
template: mid-image
min: 0
max: 1
image:
cover: true
stackedimage:
type: files
headline: Stacked image (for very narrow screens)
template: stacked-image
min: 0
max: 1
image:
cover: true
imagemeta:
type: fields
fields:
alt:
label: Alt text
required: true
type: text
tags:
label: Tags
type: tags
allowcomments:
label: Comments
type: checkboxes
options:
true: Allow comments on this comic/post?
# meta information
sidebar:
width: 2/3
sections:
content:
type: fields
fields:
date:
label: Publish date/time
type: date
time: true
default: now
required: true
transcript:
label: Transcript
type: textarea
size: small
blog:
label: Blog post
type: textarea
size: large
When loading the page via my comic.php template file, the images are all shown as entries in the $page object (e.g. $page->mainimage()), but they’re blank. I could go down the $page->files() route to get them, but then I’d lose the associative names.
Am I doing something wrong with the template?