I have a very old installation of a Kirby 2 powered website that I’m (finally!) updating. I want to do a redesign of the website at the same time, so to start with I am trying to import the old content into the Kirby Starterkit and I’ll take it further from there.
I’ve managed to successfully import pages (I still have to get the panel fields right but I think I can manage that), but the images I imported are not appearing in the panel.
Of course. The blueprint for the page is this (as you can see I have changed very little from the Starterkit note template):
# Each page blueprint must have a title, the title may be different from the file name
title: Article
# Sorting number scheme that is applied when page status is changed to `listed`
# More about page sorting: https://getkirby.com/docs/reference/panel/blueprints/page#sorting
num: date
# Each page can have an icon that is shown in page listings when no preview image is available.
icon: 📖
# Custom descriptions for each page status depending on use case
# More about page status: https://getkirby.com/docs/reference/panel/blueprints/page#statuses
status:
draft:
label: Draft
text: The note is still in draft mode. It can only be seen by editors with panel access.
unlisted:
label: In Review
text: The note 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 note is online and listed in the blog
# Define the form layout with two columns
# Columns are optional but help structure the form layout
# More about columns: https://getkirby.com/docs/guide/blueprints/layout#defining-columns
columns:
- width: 2/3
# This columns only has a single field
fields:
text:
type: blocks
- width: 1/3
# This second column holds a fields section with multiple fields
# More about fields sections: https://getkirby.com/docs/reference/panel/sections/fields
sections:
meta:
type: fields
fields:
# If you need the same field in multiple locations, you can define them once and reuse whereever needed.
# Here we use a files field defined in `/site/blueprints/field/cover.yml`
cover: fields/cover
date:
type: date
time: true
default: now
author:
type: users
# Fields types can be added using the shortcut `fieldname: true`
# (however, you can only use a fieldname once per page and this only makes sense for simple fields without configuration)
tags: true
files:
type: files
template: blocks/image
I haven’t changed the blocks/image.yml blueprint or the files/image.yml blueprint from the Starterkit.
Just a question, which I think is related. Since I imported these files from an old Kirby installation, none of them have UUIDs. I can’t seem to figure it out from the docs: is there a way to assign UUIDs to files somehow?
Sorry to bother again, I thought the issue was solved, but I am actually still encountering the problem with missing images. Ping @texnixe, I hope that’s okay.
I’ve managed to assign UUIDs and the correct template to all the image files.
# Each page blueprint must have a title, the title may be different from the file name
title: Article
# Sorting number scheme that is applied when page status is changed to `listed`
# More about page sorting: https://getkirby.com/docs/reference/panel/blueprints/page#sorting
num: date
# Each page can have an icon that is shown in page listings when no preview image is available.
icon: 📄
# Custom descriptions for each page status depending on use case
# More about page status: https://getkirby.com/docs/reference/panel/blueprints/page#statuses
status:
draft:
label: Concept
text: Het artikel is een concept en nog niet gepubliceerd. Het kan alleen worden gezien in het panel.
listed:
label: Gepubliceerd
text: Het artikel staat op de website en kan worden gezien door bezoekers.
# Define the form layout with two columns
# Columns are optional but help structure the form layout
# More about columns: https://getkirby.com/docs/guide/blueprints/layout#defining-columns
columns:
- width: 1/3
# This column only has a single field
fields:
text:
type: writer
label: Tekst
- width: 1/3
fields:
images:
type: files
template: blocks/image
label: Afbeeldingen
- width: 1/3
# This second column holds a fields section with multiple fields
# More about fields sections: https://getkirby.com/docs/reference/panel/sections/fields
sections:
meta:
type: fields
fields:
date:
type: date
time: true
default: now
label: Datum
# Fields types can be added using the shortcut `fieldname: true`
# (however, you can only use a fieldname once per page and this only makes sense for simple fields without configuration)
tags: true
This is the image blueprint, image.yml:
# Each file blueprint must have a title, the title may be different from the file name
title: Image
# Like page blueprints, file blueprints can define a layout with tabs, columns, sections and fields
# File blueprints define what sort of information should get stored in a file's meta data file
# In addition to the fields defined in this example blueprint, you can also set what type of file is acceptable
# when this blueprint is used, which allows you to control what users can upload.
# More about file blueprints: https://getkirby.com/docs/reference/panel/blueprints/file
accept:
type: image
columns:
- width: 1/2
sections:
content:
type: fields
fields:
caption:
label: Opschrift
type: textarea
size: medium
- width: 1/2
sections:
meta:
type: fields
fields:
alt:
label: Alt text (beschrijving van de afbeelding)
type: text