Section could not be loaded

Hi there,

I am trying to follow Bastian’s video How to build a website from scratch, but starting from the starterkit instead of the plainkit.

In my page I have a page type project that I need to display both in a “CV” section as well as a “Calendar” section. So I thought I create a unlisted page “Projects” where in the panel these projects of type project can be created.

So, I created the bluprint .yml files projects.yml as well as project.yml, created a projects folder in the contents folder with a projects.txt file as well as some test subfolders each with a project.txt file in it.

My problem is, in my projects page in the panel, in the projects section I get this error:

The section "projects" could not be loaded: Illegal offset type in isset or empty

I have no idea, what I did wrong.
The content of my projects.yml is simply:

title: Projects

sections:
  projects:
    type: pages

and project.yml is:

Title: Project

columns:
  left:
    width: 1/2
    sections:
      gallery:
        type: files
        layout: cards
  right:
    width: 1/2
    sections:
      content:
        type: fields
          title:
            type: text
          text:
            type: textarea

Can anybody give me any hint, what I am doing wrong? I am still new to Kirby 3.

Thanks!

I would change something in the two blueprint files.

my projects.yml:

title: Projects

sections:
  projects:
    type: pages
    create:
      - project

my project.yml:

Title: Project

columns:
  - width: 1/2
    sections:
      left:
        type: fields
        fields:
          gallery:
            type: files
            layout: cards
  - width: 1/2
    sections:
      right:
        type: fields
        fields:
          subtitle:
            type: text
          text:
            type: textarea

Hint: You don’t need a field title, so I changed it to subtitle. Or you delete it.

The error is caused by your sections in the project.yml blueprint. You define two fields sections but the fields keyword is missing:

right:
    width: 1/2
    sections:
      content:
        type: fields
        fields: # this keyword is missing in your code above in both fields sections
          title:
            type: text
          text:
            type: textarea

I’d set a template property in projects.yml as well, to make sure that only subpages with the project.yml template can be created.

sections:
  projects:
    type: pages
    templates: project # this allows only a single template for your subpages

Thanks @anon77445132 and @texnixe, this solved my problem indeed.

@texnixe: Might I kindly suggest for an error like that to come along with a more meaningful error message? Would probably help beginners like me, because with an error message like that I don’t even know where to look for the error. Thank you.

Could you please create an issue on GitHub in the Kirby or ideas repo?

Done.

1 Like

@texnixe: There is a big difference between your projects.yml blueprint and mine:

… prevents the listing of all daughter pages that use a different blueprint, which I always want to avoid.