I’m just starting out with Kirby 4.1.0 on a localhost environment.
The starting point has been a custom page blueprint called ‘Series’. It accepts a few text fields and an image file.
I’m noticing some weirdness when I open a Series page in Panel. (Panel correctly creates the page)
First, data entered into the text fields doesn’t get saved into content/test-page/series.txt. Selecting an uploaded image also doesn’t get saved into that file, either.
Second, when I upload an image via the Series page in Panel it does correctly get saved into content/test-series/ as well as its associated text file. However, the image’s URL keeps being wrong or not found, and it seems to be differently wrong in different places around the page…
- In the Select File dialogue, Chrome inspector shows – “http://localhost:8000/media/pages/ralph-the-mighty/fd5db33576-1708570983/ralph-76x.webp”
- If I try to preview or delete the image, I get an error like this –
" The requested resource/panel/dropdowns//pages/test-page/files/ralph.webp?view=list&update=true&delete=true
was not found on this server." - In the Files section on the right-hand side of the page, Chrome inspector shows – “http://localhost:8000/panel/pages/test-page/files/ralph.webp”
- And when I try moving the image’s files into a folder called ‘files’, Panel treats the new folder as a child Page.
I feel like I’ve missed something silly in the setup of my Blueprint or its registration, but I have no idea what. Any help is greatly appreciated! Thanks so much!
series.yml
title: series
preset: page
status:
draft:
label: Draft
text: The series is still in draft mode. It can only be seen by editors with Panel access.
unlisted:
label: In Review
text: The series is online and can be visited with the direct URL. The team must still give the final go to publish it.
listed:
label: Published
text: The series (and all Volumes and Books within it) can be viewed on the live site.
fields:
series-description:
label: Description of series
type: writer
toolbar:
inline: false
width: 4/4
required: false
series-image-hero:
label: Hero image
type: files
query: page.images
cover: true
limit: 1
multiple: false
.
plugins/series/index.php
<?php
Kirby::plugin('your/series', [
'blueprints' => [
'pages/series' => __DIR__ . '/blueprints/pages/series.yml'
]
]);
?>