Blueprints vs Templates?

Well, the most obvious distinction between blueprints and templates is:

  • blueprints are only needed if you use the panel, they determine what sort of content a user can add via the panel, they have a yaml-structure and can be regarded as a sort of template for the panel view. Or as is says in the docs:

Blueprints are the counterpart of each of your templates. They create individual forms in the panel which make it easy to insert the required data. Blueprints offer a wide set of options to customize those forms and even provide help to panel users while they enter data.

  • templates determine what sort of content is displayed on a page and how the content in the text files is displayed. They are created by using a mixture of PHP and HTML.

Both template and blueprint have the same name as the corresponding text file.

When you add a new page in the panel, choosing a blueprint is the same as choosing a template, cause the file gets a name that determines the template that is used to parse the contents.

In some cases, however, you may have a blueprint for page but not a template, i.e.if you do a one pager.

You can restrict the templates that can be used for a page/subpage in the blueprint: http://getkirby.com/docs/panel/blueprints/page-settings#templates-for-subpages. On the site level, you would do that via a site.php blueprint.

1 Like