I currently upgrading an old kirby 2 project to kirby 3, while following guide to updating to Kirby 3. However, I ran into a problem while trying to display the pages. I know that by default, adding pages etc. is disabled so I tried enabling this within the .yml file.
This is the head of my site.yml:
title: Site
deletable: false
pages: true
# So I tend to use subpages, but I am unsure of how this goes into practice within site.yml
subpage_builder:
- title: Landing
uid: landing
template: landing
num: 1
# This I got from the starterkit
pages:
type: pages
create: default
templates:
- about
- banner
- contact
- default
- error
# These are fields that have been migrated from my Kirby 2 project
fields:
. . .
I am unsure whether I am doing something fundamentally wrong or just missing something.
It is indeed a multi-language site, with existing contents. As shown in guide I upgraded this. Also, I indeed saw in the guide that a hook needed to be added for the subpage builder.
I did fix the t.language error. It seems that there was something wrong with my initial save. After removing the modal in the html and clicking save button (which was shown below the overlay but disappeared as I clicked on the modal).
But still, I don’t get anything to show, unfortunately.
Ok, the blueprint setup is missing the sections keyword. I think you should check out the Starterkit’s site.yml.
Title: site
sections:
pages: # a pages section which lists pages with the given templates/blueprint
create: default
templates:
- about
# etc.
fields: # a fields section
type: fields # the type is optional if the section is called fields, but you can only have one section with that name, if you need more, you have to give them other names and add the type.
fields:
text:
label: text
That’s still basic, you probably want to use columns for a more structured layout.
Argh, can’t believe I missed that. It at least shows the error page’s content now (and the option to add a page).
It still doesn’t seem to detect the other pages’ templates (and content subsequently), though.
I put my old kirby blueprints in /site/blueprints/pages/. Lets take a look at about.yml for example:
#/site/blueprints/pages/about.yml
title: About
deletable: false
subpage_builder:
- title: About Subpage
uid: about_sub
template: about_sub
num: 1
files: true
sections:
fields:
pageinfo:
label: Page Info
type: headline
title:
label: Title
type: text
menu:
label: Menu
type: checkbox
webtitle:
label: Website Title
type: text
superheroimage:
label: Superhero Image
type: select
options: files
required: true
Any thoughts on what could be wrong?
Thanks in advance!
Hm, the section should actually show all pages with the given templates. Remove the templates option from the pages section for a moment to see what happens.
Your about.yml has an invalid field, a checkbox field does not exist in Kirby 3.
Edit… It is quite obvious what the problem is. Somehow my content text files were renamed during the upgrade. After changing the about.nl.en.txt to about.nl.txt it showed up immediately.
Yet I still cannot add it as a new page with this template in the site settings