Subpage Builder Error

Hi, I’m experiencing an issue with the subpage builder.

When adding a new page to the main site directory (Dashboard -> Add Page) I get the following error:

scandir(/Users/myuser/path/to/website/content/testing-sup-page-builder): failed to open dir: No such file or directory

my site.yml looks like this:

title: Site
fields:
  title:
    label: Site Title
    type:  text

my default.yml looks like this:

title: Default Page Template
    pages:  
      build:
        - title: Gallery
          uid: gallery
          template: default
          num: 1
        - title: Info
          uid: info
          num: 2
          template: default
    fields:
      title:
        label: Title
        type:  text
      text:
        label: Text
        type:  textarea

Any ideas why it’s giving an error?
I have a clean install of Kirby 2.5.5 that I stripped down to the essentials.

best,
r

Apart from the fact that your indentation is not correct, it looks like you run into an endless loop if you have the builder create pages with the same default template that in turn builds the same subpages and so on.

title: Default Page Template
pages:
  build:
    - title: Gallery
      uid: gallery
      template: gallery
      num: 1
    - title: Info
      uid: info
      num: 2
      template: info
fields:
  title:
    label: Title
    type:  text
  text:
    label: Text
    type:  textarea

Adding a new page level 1 Dashboard->Add Page will have always the same template. The structure I’m building is:

Home
Error
About
Name of Person 4 (template person.php)
Name of Person 3 (template person.php)
Name of Person 2 (template person.php)
Name of Person 1 (template person.php)

Basically the only allowed pages to be added on root level will be people and for each person a 2 subpages.

title: Person Template

pages:  
  template: 
    - person
  build:
    - title: Person Sub Page 1
      uid: gallery
      template: gallery
      num: 1
    - title: Person Sub Page 2
      uid: about
      num: 2
      template: info

fields:
  title:
    label: Title
    type:  text

  text:
    label: Text
    type:  textarea

Still, your person blueprint does not make sense.

You only allow subpages of person with template person, but you want to create two subpages with different templates.

This bit

pages:  
  template: 
    - person

should then go into your site.yml and be removed from the person.yml (edited).

What I’m trying to achieve is to limit the available template choice for the Dashboard Add New Page to only person.yml template. Once that page is created, Kirby to automatically create two sub pages for that page: first called Gallery and the second About. Each of the two subpages to have their own .yml templates.

I got that, please read again what I wrote above.

site.yml

title: Site

pages:  
  template: 
    - person

person.yml

title: Person Template

pages:  
  template: 
    - gallery
    - info
  build:
    - title: Person Sub Page 1
      uid: gallery
      template: gallery
      num: 1
    - title: Person Sub Page 2
      uid: about
      num: 2
      template: info

fields:
  title:
    label: Title
    type:  text

The error comes from the Auto Publish Plugin. After deleting it, sub pages are created normally.

Thanks for the help texnixe!