New pages always being created as default.txt

I seem to have a problem where new pages created from the panel are always named default.txt. This is obviously a problem because that means they always use the default template/blueprint.

For example:

  • newpage.yml is in site/blueprints/pages
  • newpage.php is in site/templates
  • When I create a new page from the panel, I choose ‘new page’ from the template selection dropdown
  • The new page is created as default.txt anyway

Why is the system ignoring my template preference when creating the new page? I know my newpage.yml and newpage.php are correct because when I manually rename default.txt to newpage.txt everything works as intended.

Forcing child pages to use a specific template by specifying it in the parent blueprint works fine. However choosing a template from the drop-down menu seems to be broken for me.

The above settings should create a file called ‘error.txt’, but it creates ‘default.txt’ instead. I have multiple templates and no matter which one I choose the system always creates ‘default.txt’.

Any help is greatly appreciated!

I’ve done more testing.

It appears that Kirby is working fine – the real issue is that the template dropdown is broken in Microsoft Edge.

If I use the template dropdown in other browsers, the correct template is used to create the new page. If I use the template dropdown in Edge, it will always select the FIRST option, regardless of what the user has chosen.

Seems to be some kind of weird UI issue.

Maybe this is somewhat related: https://github.com/getkirby/kirby/issues/1687

Yes, I posted that on github after I found out what the problem was. :blush:

I know, that’s why I posted it here for reference, so that other people who run into this know that there is already an issue on GitHub.

1 Like

Hello, I’m new here and wanted to try Kirby 3, but there is a problem.

I can’t chose between different templates while creating a new page in the panel. So it always creates a “default.txt”-file. If I rename the “default.txt” in my folder it’s disappearing in my panel. If I rename it again to “default.txt” it’ll be shown in the panel again. When I look on my site the page-link in the menu is always there. Only the panel doesn’t want to show the new pages when I rename the “default.txt” in my folder…

I’m using Mac Mojave + MAMP + the Kirby Starterkit-master and tried it with safari and firefox.

Can anybody help?

Hey, @Isabelle,

welcome to the Kirby forum.

In the Starterkit’s /site/blueprints/site.yml file, the pages section limits what templates it shows and what can be created:

# The site blueprint must have a title, the title may be different from the file name
# The `site.yml` blueprint defines the look of the start page (Dashboard) of the Panel.
title: Site

# The site blueprint usually provides easy access to all main pages of the site.
# In this example blueprint, we also show subpages of the `photography` and `notes` pages.
# More about the site blueprint: https://getkirby.com/docs/reference/panel/blueprints/site

# The layout of this form has two columns:
columns:
  # The first column has one section for the subpages of the `photography` page in card layout
  # It reuses the pages section defined in `/site/blueprints/sections/albums.yml`
  - width: 1/2
    sections:
      albums: sections/albums

  # The second column has two sections, `notes` and `pages`
  - width: 1/2
    sections:
      # The `notes` section reuses the pages section defined in `/site/blueprints/sections/notes.yml`
      notes: sections/notes

      # The `pages` pages section shows other main pages of the site
      # Using the `templates` option, we limit which types of pages are shown
      # Using the `create` option, we limit the type of page that can be created when a new page is created
      # Note that the `sandbox` page and the `error` page that also exist in the content folder but use different blueprints thus do not show up in the list
      # Since the error page's blueprint is set to `read: false`, it wouldn't show up here even if you added the error blueprint to the templates list
      pages:
        type: pages
        create: default
        templates:
          - about
          - home
          - default

(Comments are not in the Starterkit, it’s a copy of an annotated version I created recently)

So to allow creating pages with something else then the default templates, you can pass multiple blueprints to the create property:

      pages:
        type: pages
        create: 
          - default
          - whatever
        templates:
          - about
          - home
          - default
1 Like

Hello texnixe, thank you very much!

It’s working perfectly now :relaxed:

1 Like

The issue was fixed in 3.2.4.

Hello, four years later I have the same problem like Isabelle: Newly created pages are only displayed in the panel if the assigned text file is called default.txt - even if there is no default.php under templates. I followed the video instructions step by step and everything worked perfectly up to the point where the panel was introduced. Mac OS Ventura and MAMP with PHP 8.0.3. Thanks in advance! Ralph

Are you using the Starterkit as basis? Please provide some more context, thank you!

Thanks for the quick answer! I downloaded the plainkit and followed your video tutorial step by step. Everything went perfect until I reached “Your first blueprint”. In my panel, none of the project pages were visible. So I suspect that my setup is somehow different than the one in your video…

I just installed Laravel Valet, to find out if the problem is related to my MAMP installation, but here it’s exactly the same.

Well, sorry, cannot remember the video content. But if you post your blueprint(s), I’m pretty sure we can sort this out.

I did not touch the blueprints so far. default.yml is still:

title: Default Page

columns:
main:
width: 2/3
sections:
fields:
type: fields
fields:
text:
type: textarea
size: huge
sidebar:
width: 1/3
sections:
pages:
type: pages
template: default
files:
type: files

And site.yml:
title: Site

sections:
pages:
type: pages

The template/templates property here in the pages section defines with which template a new page is created(and also, which pages will be shown in that section (when created manually in the file system). So a section with template: default will only display pages named default.txt

If you remove this line, all pages - no matter their intended template - will be displayed.

Works now, thank you very much!!!