# Inconsistent behavoir & absence of documentation for \`title\` and \`label\` property for the page-template

**URL:** <https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836>\
**Category:** Questions\
**Tags:** v3\
**Created:** [October 23, 2020, 1:54pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836 "2020-10-23T13:54:34Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![N247S](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/n247s/32/9130_2.png) [@N247S](https://forum.getkirby.com/u/N247S)\
**Post date:** [October 23, 2020, 1:54pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/1 "2020-10-23T13:54:34Z")

</div>

Continuing the discussion from [Duplicating & changing title still possible eventhough option is set to disabled](https://forum.getkirby.com/t/duplicating-changing-title-still-possible-eventhough-option-is-set-to-disabled/19523/8):

I just found something out about the page-bleuprint’s `title` and `label` property when trying out the page-template mechanism _which does not seem to be documented_!

first of all, _every_ page-blueprint is interpreted as an available page-template which was surprising as I thought those needed to be registered in the `template` plugin hook? (but I suspect those with no actual page-template file will fallback to the `default.php` template).

Second; The `title` property is apparently used for the actual page-title with a fallback to the `label` property, while the `label` property is actually used as ‘page-template/blueprint name’ which is showed whe creating a new page. The `label` property has the `title` property as fallback, which is a verry curious choice to be honest. Since the `title` property allows `query language` syntax, but the label doesn’t.

So if I want to create a new page, there is a bunch of options (one for every page-bleuprint) with the label `{{page.title}}`. I think it would be much better to use the syntax `{plugin_namespace}/{file_name}` or something simular as fallback instead. (as there is now simply no way to find the difference between `{{page.title}}` and `{{page.title}}` 😛)

Upon this discovery there are two questions for me:

1. How to exclude a page-blueprint to be interpreted as an avialable page-template?
2. How does this work with ‘page models’, I mean in the documenation it is mentioned you need to create an php-class extending the `Page` class, with a filename corresponding the page-template filename. Does this mean one can skip the page-template and simply use a page-blueprint file instead?

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [October 23, 2020, 2:05pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/2 "2020-10-23T14:05:23Z")

</div>

> [@N247S](#):
>
> as I thought those needed to be registered in the `template` plugin hook

No, only blueprints that you want to provide via plugin need to be registered-

> [@N247S](#):
>
> The `title` property is apparently used for the actual page-title

The blueprint title property is used for display in the page create dialog, not for the page title. If a page has no title, Kirby falls back to the folder name. A blueprint has no ` label` property (tabs and fields have a label property)

> **[Page blueprint](https://getkirby.com/docs/reference/panel/blueprints/page)**
>
> Page blueprints are located in /site/blueprints/pages and control the Panel setup and form fields for pages.

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [October 23, 2020, 2:08pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/3 "2020-10-23T14:08:36Z")

</div>

> [@N247S](#):
>
> Does this mean one can skip the page-template and simply use a page-blueprint file instead?

I don’t understand this question

Blueprint is a yaml file that defines the fields etc. for the Panel.  
Template is a php file with the HTML that is rendered on the frontend.  
Two different things.

---

<div class="post-metadata">

**Author:** ![N247S](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/n247s/32/9130_2.png) [@N247S](https://forum.getkirby.com/u/N247S)\
**Post date:** [October 23, 2020, 2:17pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/4 "2020-10-23T14:17:02Z")

</div>

> [@pixelijn](#):
>
> Blueprint is a yaml file that defines the fields etc. for the Panel.  
> Template is a php file with the HTML that is rendered on the frontend.  
> Two different things.

That is what I thought as well, but currently I have only one template registered. And multiple page-blueprints. Eventhough I did not register additional page-templates I can still choose from every single page-template backed by the defined page-blueprints when I want to add a new page. (I do everything through plugins, to keep the original Kirby installation intact btw.)

I have to say though, that I put the `site` as parent for the `pages section`, if that should make a difference.

---

<div class="post-metadata">

**Author:** ![N247S](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/n247s/32/9130_2.png) [@N247S](https://forum.getkirby.com/u/N247S)\
**Post date:** [October 23, 2020, 2:18pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/5 "2020-10-23T14:18:51Z")

</div>

> [@pixelijn](#):
>
> The blueprint title property is used for display in the page create dialog, not for the page title. If a page has no title, Kirby falls back to the folder name. A blueprint has no ` label` property (tabs and fields have a label property)

I linked a specific post in the discussion. As seen there both the `title` and `label` yields the same visual result, eventhough it is undocumented.

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [October 23, 2020, 2:26pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/6 "2020-10-23T14:26:12Z")

</div>

The result is not the same, it shows for example `Pages/album` instead of `Album` when you use `title: Album`? So the fallback is to the blueprints foldername/blueprintname. So to prevent the fallback name, you have to use the `title` like starting with a lower-case t

---

<div class="post-metadata">

**Author:** ![N247S](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/n247s/32/9130_2.png) [@N247S](https://forum.getkirby.com/u/N247S)\
**Post date:** [October 23, 2020, 2:35pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/7 "2020-10-23T14:35:08Z")

</div>

I just tested that, and it seems to check out. So `label` is no fallback. That still leaves the page-template addition problem. How to prevent that?

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [October 23, 2020, 2:40pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/8 "2020-10-23T14:40:51Z")

</div>

> [@N247S](#):
>
> That still leaves the page-template addition problem.

I don’t really understand the problem. What is your use case?

---

<div class="post-metadata">

**Author:** ![N247S](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/n247s/32/9130_2.png) [@N247S](https://forum.getkirby.com/u/N247S)\
**Post date:** [October 23, 2020, 2:43pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/9 "2020-10-23T14:43:06Z")

</div>

😃 none? I simply noticed that page-bleuprints were added as page-templates without eplicitly registering them. And I don’t want that because some page-templates are either ‘singletons’ or plugin-specific templates.

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [October 23, 2020, 2:50pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/10 "2020-10-23T14:50:34Z")

</div>

> [@N247S](#):
>
> because some page-templates are either ‘singletons’

What does that mean?

Plugin-specific blueprint can be overridden by putting a blueprint with the same name into `/site/blueprints`, so that’s a feature.

And there is no way to not auto-register such blueprints apart from simply removing them if you don’t want or need them.

---

<div class="post-metadata">

**Author:** ![N247S](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/n247s/32/9130_2.png) [@N247S](https://forum.getkirby.com/u/N247S)\
**Post date:** [October 23, 2020, 3:00pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/11 "2020-10-23T15:00:03Z")

</div>

oke, let put some sample code, because I don’t think its the ‘auto-register’ feature which is doing something.

```auto
plugin
  blueprints
    pages
      page1.yml
      page2.yml
      page3.yml
  templates
    default.php

```

```php
#index.php

App::plugin('my/plugin', [
    'templates' => buildArray( __DIR__. '/templates'),
    'blueprints' => buildArray( __DIR__. '/blueprints')
]);

//////////////////////////////////////////////////
// Internal utility
//////////////////////////////////////////////////

function buildArray(string $dir)
{
    $a = array();
    return _buildArray($dir, '', $a);
}

function _buildArray(string $dir, string $prefix = '', array &$arr)
{
    foreach (scandir($dir) as $file) {
        $bn = pathinfo($file);

        if ($bn['basename'] !== '.' && $bn['basename'] !== '..') {
            $ap = $dir . DIRECTORY_SEPARATOR . $file;

            if (is_dir($ap)) {
                _buildArray($ap, $prefix . $bn['basename'] . '/', $arr);
            } else $arr[$prefix . $bn['filename']] = $ap;
        }
    }
    return $arr;
}

```

The above code is all I currently have which is doing something with bleuprints & templates. Eventhough there is just 1 template in existence. I can still choose the 3 based on the blueprint files (again, eventhough I do _not_ register any templates based on those blueprint files!).

Does that refer to ‘auto-registering’? or is there something I am missing here?

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [October 23, 2020, 3:25pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/12 "2020-10-23T15:25:05Z")

</div>

> [@N247S](#):
>
> I can still choose the 3 based on the blueprint files

Choose where? In the create page dialog? But what you choose in the create page dialog is the blueprint, not the template (event though it is called template (as in “intendedTemplate”). The name of the blueprint you choose when creating a new page is responsible for your content text file name which in turn defines which template is used when it gets to rendering a page (either a template with that name or the default template if the intended template does not exist).

So if I’m not mistaken this is probably a misunderstanding due to the label of the select field in the page create dialog?

---

<div class="post-metadata">

**Author:** ![N247S](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/n247s/32/9130_2.png) [@N247S](https://forum.getkirby.com/u/N247S)\
**Post date:** [October 23, 2020, 3:29pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/13 "2020-10-23T15:29:57Z")

</div>

🤦‍♂️ names are always my nemesis… Yes that has been the misunderstanding apparently

So how does one decide which (actual) template should be used for a new page? I mean, is that customizable by a panel user? Or better put, is there a way to change it afterwards if the content is exactly the same? (e.g. make a general-post into a review-post for example. Content is exactly the same, but it is displayed a little differently)

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [October 23, 2020, 3:31pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/14 "2020-10-23T15:31:55Z")

</div>

> [@N247S](#):
>
> So how does one decide which (actual) template should be used for a new page?

You decide what template is used by choosing the blueprint/template with the same name as the template you want to use for rendering:

Example:

When you create a page, you choose ` album.yml` as blueprint/template in the select field in the page create dialog.

The page is created with content txt file `album.txt`

If album.php template exists, that will be used to render file.

> **[Kirby in a nutshell](https://getkirby.com/docs/cookbook/setup/kirby-in-a-nutshell#the-role-of-filenames)**
>
> Or what you wish you had known when you started your first Kirby project.

---

<div class="post-metadata">

**Author:** ![N247S](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/n247s/32/9130_2.png) [@N247S](https://forum.getkirby.com/u/N247S)\
**Post date:** [October 23, 2020, 3:35pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/15 "2020-10-23T15:35:15Z")

</div>

So if I want to create multiple pages based on the same blueprint (eventhough the names do not match). Does that mean it will choose the ‘default’ template, just because the page-name (and therefore the file-name) do not match?

---

<div class="post-metadata">

**Author:** ![pixelijn](https://avatars.discourse-cdn.com/v4/letter/p/7ab992/32.png) [@pixelijn](https://forum.getkirby.com/u/pixelijn)\
**Post date:** [October 23, 2020, 3:50pm UTC](https://forum.getkirby.com/t/inconsistent-behavoir-absence-of-documentation-for-title-and-label-property-for-the-page-template/19836/16 "2020-10-23T15:50:03Z")

</div>

You can create as many pages as you like based on the same blueprint. If you have a parent blog page, for example, all your blog page children will probably use the same blueprint `blog-article` (of course, you could also have different types as subpages, but that’s another story).

Have a look at the Starterkit as example. All subpages of notes use the `note.yml` blueprint, all subpages of `photography` use the `album.yml` blueprint (and therefore all have a `note.txt`/album.txt` content file).

The subpages in notes are rendered with the ` note.php` template, the subpages in `photography` with the `album.php` template.
