# Subpage Builder Error

**URL:** <https://forum.getkirby.com/t/subpage-builder-error/8688>\
**Category:** Questions\
**Tags:** v2\
**Created:** [October 4, 2017, 10:01am UTC](https://forum.getkirby.com/t/subpage-builder-error/8688 "2017-10-04T10:01:18Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rrr](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Rrr](https://forum.getkirby.com/u/Rrr)\
**Post date:** [October 4, 2017, 10:01am UTC](https://forum.getkirby.com/t/subpage-builder-error/8688/1 "2017-10-04T10:01:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [October 4, 2017, 10:06am UTC](https://forum.getkirby.com/t/subpage-builder-error/8688/2 "2017-10-04T10:06:17Z")

</div>

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.

```auto
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

```

---

<div class="post-metadata">

**Author:** ![Rrr](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Rrr](https://forum.getkirby.com/u/Rrr)\
**Post date:** [October 4, 2017, 10:13am UTC](https://forum.getkirby.com/t/subpage-builder-error/8688/3 "2017-10-04T10:13:33Z")

</div>

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
```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [October 4, 2017, 10:17am UTC](https://forum.getkirby.com/t/subpage-builder-error/8688/4 "2017-10-04T10:17:27Z")

</div>

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

```auto
pages:  
  template: 
    - person

```

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

---

<div class="post-metadata">

**Author:** ![Rrr](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Rrr](https://forum.getkirby.com/u/Rrr)\
**Post date:** [October 4, 2017, 10:23am UTC](https://forum.getkirby.com/t/subpage-builder-error/8688/5 "2017-10-04T10:23:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [October 4, 2017, 10:25am UTC](https://forum.getkirby.com/t/subpage-builder-error/8688/6 "2017-10-04T10:25:42Z")

</div>

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

site.yml

```auto
title: Site

pages:  
  template: 
    - person

```

person.yml

```auto
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

```

---

<div class="post-metadata">

**Author:** ![Rrr](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Rrr](https://forum.getkirby.com/u/Rrr)\
**Post date:** [October 4, 2017, 10:42am UTC](https://forum.getkirby.com/t/subpage-builder-error/8688/8 "2017-10-04T10:42:13Z")

</div>

The error comes from the [Auto Publish Plugin](https://github.com/groenewege/kirby-auto-publish). After deleting it, sub pages are created normally.

Thanks for the help texnixe!

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:32pm UTC](https://forum.getkirby.com/t/subpage-builder-error/8688/10 "2025-02-06T17:32:02Z")

</div>

Archived on February 6, 2025, 5:32pm UTC


