Configuring the drop-down list for Templates in the Panel

Hello everybody! :slight_smile:

I’m experimenting since hours with the kirby demo site to figure out the logic behind the the drop-down list of templates in the panel.

I even created a table to understand how the menu will composed .

    blueprints          |   templates           |   pages               |   pages: (subpage temp.)          |   files:                  |
-----------------------------------------------------------------------------------------------------------------------------------------
    default.yml         |   default.php         |   About, Contact      |   true (Page, Project, Projects)  |   true (Files)            |
    error.yml           |   default.php         |   Error               |   false                           |   false                   |
    home.yml            |   home.php            |   Home                |   false                           |   –––– (Files)            |
    project.yml         |   project.php         |   Project A           |   false                           |   sortable: true (Files)  |
    projects.yml        |   projects.php        |   Projects            |   template: projects  (Projects)  |   false                   |
    site.yml            |                       |   Site                |   default (Page)                  |   (Site files)            |

Please enlighten me, I don’t get it. :worried:

Hint:
Look at https://getkirby.com/docs/panel/blueprints/subpages-settings for details.

Good luck!

1 Like

Hi @anon77445132, I did multiple times but it doesn’t helped me. And I also searched and read many threads in the forum. I did my research…

The “Template” in the panel has nothing to do with the kirby template, which is used to build the site. It’s the blueprint used by the panel, shown with it’s title, which is set in the blueprint.
Of course there should (always) be a blueprint with a corresponding kirby template, because the template may rely on special fields used in the blueprint.

And the list of “Templates” available is determined by the blueprint settings, as @anon77445132 mentioned.

2 Likes

So far so good. So I also understand it. :cry:

For example:

title: Home
pages: false
fields:
  title:
    label: Title
    type:  text
  text:
    label: Text
    type:  textarea

If I set pages: true home (or error template) wont show up in the drop-down list for subpages under a default site (like about).

And if you only define pages: true in the blueprint, as in the default.yml blueprint of the starterkit, all blueprints (Templates) are displayed in the dropdown menu. Exceptions are the error and home blueprint, because there is only one page of them. The site blueprint isn’t displayed as well, because it holds the settings for the top level of pages and fields for the Settings menu.

1 Like

So my fault was, that I thought I could cause home or error to appear in the drop-down list? But the won’t because the are special? :confounded:

The important thing to understand is that the blueprint of the current open page defines the blueprints that can be used for the subpages of that page.

  • the site.yml blueprint defines the allowed blueprints for all pages of the first level under /content, if this setting is set to true, all blueprints are allowed; you can define individual allowed blueprints with the templateoption.
  • the same for any other page, if a page uses for example the about blueprint and about is not allowed to have subpages, then the template dropdown will be grayed out
  • if the blueprint defines two allowed templates for all subpages of pages that use the default.yml blueprint, then those two blueprints/templates will be shown in the dropdown.

Home or error can appear in the dropdown list if you specifically allow them as blueprints for subpages.

2 Likes

Yes, the home and error blueprint are special, but I don’t know what happens, if you specify them explicitly in the templates list in your blueprint.

2 Likes

Thank you very much @texnixe for the clear and detaild explanation. :+1: I think I have to go back an do some more experiments to fully understand what’s going on. :nerd:

2 Likes

Yes, it’s a bit difficult to understand at first, with the option being called template while in reality it loads a blueprint and not a template and with page and subpage settings. However, the community is here to help whenever you get stuck :slight_smile:

1 Like

Only one correction here: if the about page has pages: false set, you won’t even be able to get to this dialog. :wink: If you have only allowed one blueprint/template via the templates property, then the template select menu will be grayed out.

1 Like

You are absolutely right. Thanks for clarifying :slight_smile: