I will try to be systematic here and keep my “everything is an opportunity to make a joke” tendencies to a minimum. I definitely appreciate how fast you got back to me. I don’t even want to think about what time it was there…
My Dev Environment:
- Mac (Monterey 12.1; M1)
- Apache 2.4 installed via Homebrew.
- PHP 7.4, also Homebrew
The starting point of this project was Plainkit copiedover from a cloned GitHub repo.
I also keep a cloned version of Starterkit around that has an virtual host from the same Apache install pointed at it, and the issue does NOT occur if I delete images (or any other files) from the panel
Dramatis Personae
-
Infocard
- The dumb name I gave the content sections that are arranged on the Home page.
- Each infocard is, unsurprisingly, a subpage of the Home page.
- Images are optional. The template handles them if they’re there, doesn’t worry about them if they aren’t.
- There is only a place for one image in the Infocard template, but the primary user of this site is nine-years-old (long story, but not relevant) so I suspect what image is desired will always be a moving target. Thus, many can be uploaded, but only one can be chosen.
-
Image
- The blueprint primarily captures the Alt tag information.
- Eventually there will be some cropping and resizing tools
What’s Supposed to Happen
- Create a new Infocard from the Home page using the ‘Add’ button.
- Fill in all the blanks. Save.
- Change your mind.
- Delete it. Save.
- Change your mind again and recreate it. Save.
- Decide that what this deathless prose really needs is a picture.
- Find a picture. Upload it from the files section marked “Upload Photos.”
- Decide you hate the picture.
- Delete it from the files section by clicking on the “…” and clicking
delete.
- Obsessively choose 6 or 7 other photos and upload all of them.
- Decide you hate #3 and delete it.
- Realize it was #4 you wanted to get rid of, so you get rid of it, too.
- Choose #2 of all the pictures you uploaded over in the files field.
- Decide the whole thing was a terrible idea and delete the entire page from the settings button in the header area of the panel page.
What Really Happens



-
It’s possible to delete the Infocard at this point


-
Ominous music starts playing.
-
Music shifts to minor chord
- You’re asked to confirm that you really, really want to delete the file. Upon further reflection, you do.
- You are presented with these immortal words:
Error: Trying to access array offset on value of type null
attractively arrayed across the top of the modal dialog with a stunning red background and a helpful go-away x icon. You do, indeed, tell it to go away.
- You skip the whole “upload a bunch of other pictures” and jump straight to trying to delete the whole Infocard. No joy. Even though way back in #4 you were able to do it.
And that’s pretty much where it stops. It’s all terrible dialog at this point.
Needless to say I wasn’t able to suppress my writing style and I hope it didn’t get too annoying. I’ve spent more hours trying to track this down myself than anyone with a remaining shred of dignity would care to admit. Writing this has been cathartic, though, I also had my dignity surgically removed several years ago. As a freelancer I can go with any job title I like and I’ve settled on ‘Cautionary Tale.’ For some reason.
I’ve learned a lot about how the parts of Kirby fit together (though there’s always more to learn), so every bit of this time has been worth it, but I really kind of want to move on with finishing this.
Thank you for enduring this missive. There is actually a question buried in here :-).
The Files:
/site/bluprints/files/image.yml
title: Basic Image
accept:
type: image
mime: image/jpeg, image/png, image/svg+xml
columns:
#main content
main:
width: 1/2
sections:
details:
type: fields
fields:
caption:
label: Caption
type: textarea
size: tiny
alt:
label: Alt Text
type: text
icon: code
required: true
help: This **required** field is very important in order to be considerate of people who must use screenreaders to access webpages.
link:
label: link
type: url
sidebar:
width: 1/2
sections:
(The file really does stop that abruptly.)
/site//blueprints/pages/infocards.yml
title: infocard
columns:
- width: 1/2
sections:
heading:
type: fields
fields:
headline:
required: true
minlength: 3
maxlength: 75
label: Infocard Headline
type: text
help: The overall title of this Infocard.
width: 1/1
body:
type: fields
fields:
text:
label: Text
type: textarea
required: true
help: |
####Things to know:####
- There's a limit of 2000 characters (including spaces) which should give you about 300 or so words. (If you have more than that to say, it's a blog post.)
- Pressing **`return`** _twice_ starts a new paragraph. There should be a blank line between paragraphs. Don't worry: it only counts as one character.
minlength: 1
maxlength: 2000
size: medium
font: monospace
buttons:
- italic
- bold
- "|"
- ol
- ul
- "|"
- link
- email
width: 3/4
photo:
label: Select Uploaded Photo...
type: files
layout: cards
uploads: false
multiple: false
query: page.images
image:
cover: true
ratio: 5/3
back: black
info:
max: 1
empty: Choose a photo you want to use from the ones you've already uploaded.
iscta:
width: 7/12
label: Do you need a Call-to-Action Button?
type: toggle
default: false
text:
- "No"
- "Yes"
ctalink:
when:
iscta: true
label: Call-to-Action Link
type: url
width: 7/12
help: The URL for the page you want the reader to go to.
ctatext:
when:
iscta: true
label: Action Button Text
type: text
help: This text will appear in the button that the reader will click.
minlength: 2
maxlength: 20
width: 7/12
icon: edit
- width: 1/2
sections:
uploaded:
type: files
headline: Upload Photos
template: image
query: page.images
(I’m not really sure you need what follows this, but it’s not like we’re being charged by the character here)
/site/blueprints/pages/home.yml
title: Home
preset: pages
drafts:
headline: Draft Infocards
empty: There are no Infocards yet
templates:
- infocard
help: |
- This is where you initially create a new section for the Home Page. They're called `Infocards` ... because they have to be called _something_.
- The only people who can see these drafts are people who are logged into the panel. Like you right now.
unlisted:
headline: Infocards Under Review
empty: No Infocards are being reviewed. They must first be created.
listed:
headline: Published Infocards
layout: cards
text: "{{page.headline}}"
info: "{{page.image.name}}.{{page.image.extension}}<br>{{page.image.width}}px (w) x {{page.image.height}}px (h)<br>{{page.ctalink}}"
image:
cover: true
ratio: 16/5
empty: There are no Infocards on the Home Page yet. You probably want to change that.
help: |
- Infocards will appear on the home page in the same order that they appear here. The order can be changed at any time.
- If there are an odd number of Infocards, the last one will be wider and centered on the page.
- Try to keep the longest Infocard last. Keeping Infocards relatively short is better.
I’m not including the templates because they work fine.