# Template for subpage is not selectable

**URL:** <https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153>\
**Category:** Questions\
**Tags:** v3\
**Created:** [August 5, 2019, 9:01am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153 "2019-08-05T09:01:46Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![webrocker](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/webrocker/32/4839_2.png) [@webrocker](https://forum.getkirby.com/u/webrocker)\
**Post date:** [August 5, 2019, 9:01am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/1 "2019-08-05T09:01:46Z")

</div>

Hi,

I have a (minimal) blueprint for a blog page - basically only

```auto
title: Blog
preset: pages

```

however, on this page, when I click “add new” in the panel, only the template “Blog” is selected, and the select is disabled.  
I have existing subpages in the content directory /content/blog/1\_article-a/blogpost.txt  
and a blueprint for the blogpost template:

```auto
title: Blog-Post
preset: page
fields:
    headline:
        label: Überschrift
        type: text
    summary:
        label: Zusammenfassung
        type: textarea
    body:
        label: Inhalt
        type: textarea
    date_start:
        label: Veröffentlicht ab
        type: date
        width: 1/3
    date_end:
        label: Veröffentlicht bis
        type: date
        width: 1/3
    url:
        label: Link
        type: url
        width: 1/3
    projects:
        label: Projekt-Bezug
        type: pages
        query: site.find('projects').children.template('project')
        layout: cards
        image:
            ratio: 3/1

```

those pages work as expected, only I cannot add a new blogpost via the panel.

Strangely a similar setup for project/projects in the same install works fine:

Projects blueprint:

```auto
title: Projects Page
preset: page
pages: project
    limit: 50
files: false
fields:
    competences:
        label: Kompetenzen
        type: tags

```

Project blueprint:

```auto
title: Project Page
preset: page
pages: false
files:
    layout: cards
fields:
    client:
        label: Kunde
        type: text
    project:
        label: Projekt
        type: text
        width: 1/2
    url:
        label: Link
        type: url
        width: 1/2
    competences:
        label: Kompetenzen
        type: tags
        accept: options
        options: query
        query: site.find("projects").competences.split
    ended:
        label: Status
        type: toggle
        text: Beendet
        width: 1/3

    date_start:
        label: Projektbeginn
        type: date
        when:
            ended: true
        width: 1/3
    date_end:
        label: Projektende
        type: date
        when:
            ended: true
        width: 1/3

```

I have a controller for “blog”, but this should not influence the panel?

controllers/blog.php

```auto
	return function ($site,$page) {
		// set htmltitle
		$title = $page->title() . ' - ' . $site->title();

		// fetch items for hero-slider
		$heroSlides = [];
		$heroIntro = page('projects')->find('intro');
		$heroSlides = page('home/projects')->active_projects()->toPages()->shuffle();
		$heroSlides->prepend($heroIntro);

		$articles = $page->children()->listed();
		$articlesPublished = $articles->filter(function($child){
			$now = time();
			$start = $child->date_start()->toDate();
			$end = $child->date_end()->toDate();
			if (!empty($end) && $end < $now || !empty($start) && $start > $now) {
				return false;
			} else {
				return $child;
			}
		});
		$articlesSorted = $articlesPublished->sortBy(function ($child) {
  			return $child->date_start()->toDate();
		}, 'desc');

		return [
			'articles' => $articlesSorted,
			'htmltitle' => $title,
			'heroSlides' => $heroSlides
		];
	}

```

(yeah I know, there’s still room for improvement 😉

But I’m at a loss regarding the template of the blog posts…

cheers,  
Tom

---

<div class="post-metadata">

**Author:** ![bastianallgeier](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bastianallgeier/32/7569_2.png) [@bastianallgeier](https://forum.getkirby.com/u/bastianallgeier)\
**Post date:** [August 5, 2019, 9:07am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/2 "2019-08-05T09:07:19Z")

</div>

Try adding the templates option to the blog blueprint:

```auto
title: Blog
preset: pages
templates: blogpost

```

---

<div class="post-metadata">

**Author:** ![webrocker](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/webrocker/32/4839_2.png) [@webrocker](https://forum.getkirby.com/u/webrocker)\
**Post date:** [August 5, 2019, 9:17am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/3 "2019-08-05T09:17:14Z")

</div>

![nope](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/2/2b850157c18e5a985ea36624d020d254297b64a2.png)

No changes to the template selection.

---

<div class="post-metadata">

**Author:** ![bastianallgeier](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bastianallgeier/32/7569_2.png) [@bastianallgeier](https://forum.getkirby.com/u/bastianallgeier)\
**Post date:** [August 5, 2019, 9:25am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/4 "2019-08-05T09:25:27Z")

</div>

That’s so weird.

Could you try to add the sections manually?

```auto
title: Blog
sections: 
  drafts: 
    headline: Entwürfe
    type: pages
    template: blogpost
    status: draft
  published: 
    headline: Veröffentlicht
    type: pages
    template: blogpost
    status: published

```

---

<div class="post-metadata">

**Author:** ![webrocker](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/webrocker/32/4839_2.png) [@webrocker](https://forum.getkirby.com/u/webrocker)\
**Post date:** [August 5, 2019, 9:30am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/5 "2019-08-05T09:30:12Z")

</div>

![32](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/8/86630eaa92133552cc08dd78497908ea5cc53cd4.png)

strange. still no difference. Other changes, like changing the title or the labels, get applied immediatly.  
Is “blog” something that’s used in the system? On the other hand, I already tried to rename the blueprint and text files, made no difference.

---

<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:** [August 5, 2019, 9:31am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/6 "2019-08-05T09:31:14Z")

</div>

> [@webrocker](#):
>
> Is “blog” something that’s used in the system?

No, definitely not.

And the blog page is definitely using the blog blueprint? I.e. the text file inside the blog folder is called `blog.txt`?

---

<div class="post-metadata">

**Author:** ![webrocker](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/webrocker/32/4839_2.png) [@webrocker](https://forum.getkirby.com/u/webrocker)\
**Post date:** [August 5, 2019, 9:36am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/7 "2019-08-05T09:36:51Z")

</div>

> And the blog page is definitely using the blog blueprint? I.e. the text file inside the blog folder is called `blog.txt` ?

Hi thanks for looking into this. yes, the blog.txt is in `/content/2_blog/`:

 ![32](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/d/d360e566426712b4c1e22cf32ede6f08e64299a4.png)

---

<div class="post-metadata">

**Author:** ![webrocker](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/webrocker/32/4839_2.png) [@webrocker](https://forum.getkirby.com/u/webrocker)\
**Post date:** [August 5, 2019, 9:41am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/8 "2019-08-05T09:41:17Z")

</div>

This is weird. Everything works as expected - if I create a new page via the panel (with the wrong template) and then rename that blog.txt to blogpost.txt, all is well in the panel.  
If I create new folders and the txt manually in the filesystem, it works, too.  
I even deleted my blog and blogpost controller, just to see if this makes a difference, which it doesn’t.  
This is the latest Kirby Version btw, I only installed it last friday.

---

<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:** [August 5, 2019, 9:44am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/9 "2019-08-05T09:44:00Z")

</div>

That is really weird. If I put those two files into a Starterkit, it works as expected. Have you tried to clear the browser cache, delete all sessions files etc.?

---

<div class="post-metadata">

**Author:** ![webrocker](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/webrocker/32/4839_2.png) [@webrocker](https://forum.getkirby.com/u/webrocker)\
**Post date:** [August 5, 2019, 9:53am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/10 "2019-08-05T09:53:13Z")

</div>

This gets stranger by the minute. If I delete the blog.txt, and put in a new default.txt, the _this_ is the only template pre-selected for the subpages.

 ![17](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/c/cef2e50d1c590edee14deac5ec369586c968e734.png)

In the meantime I deleted all session data (logged me out), and cleared the browser cache/session, and started new. O\_o

---

<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:** [August 5, 2019, 9:54am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/11 "2019-08-05T09:54:48Z")

</div>

> [@webrocker](#):
>
> This get stranger by the minute. If I delete the blog.txt, and put in a new default.txt, the _this_ is the only template pre-selected for the subpages.

Yes, that’s because of this setting in `default.yml` (at least if you still have the one from the Starterkit)

```auto
pages:
  template: default

```

So it’s currently the one thing that is **not** weird 😉

---

<div class="post-metadata">

**Author:** ![webrocker](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/webrocker/32/4839_2.png) [@webrocker](https://forum.getkirby.com/u/webrocker)\
**Post date:** [August 5, 2019, 10:02am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/12 "2019-08-05T10:02:46Z")

</div>

Yes it is, since in my default.yml there’s no limitation for the templates (and in every other page with default template I can select the other templates). I’m at a total loss here. This happens only in the blog/ content, no matter how I rename the files.

---

<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:** [August 5, 2019, 10:03am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/13 "2019-08-05T10:03:38Z")

</div>

Is your project publicly available on GitHub for testing?

---

<div class="post-metadata">

**Author:** ![webrocker](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/webrocker/32/4839_2.png) [@webrocker](https://forum.getkirby.com/u/webrocker)\
**Post date:** [August 5, 2019, 10:07am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/14 "2019-08-05T10:07:01Z")

</div>

I can sent you a zip… there’s no really sensitive info involved

---

<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:** [August 5, 2019, 10:08am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/15 "2019-08-05T10:08:18Z")

</div>

Fine, can you send me link via PM?

---

<div class="post-metadata">

**Author:** ![webrocker](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/webrocker/32/4839_2.png) [@webrocker](https://forum.getkirby.com/u/webrocker)\
**Post date:** [August 5, 2019, 10:14am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/16 "2019-08-05T10:14:11Z")

</div>

(in the menatime I tested with a different browser to exclude some local JS problems or else… no difference)

you got mail errm DM 😉

---

<div class="post-metadata">

**Author:** ![bastianallgeier](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bastianallgeier/32/7569_2.png) [@bastianallgeier](https://forum.getkirby.com/u/bastianallgeier)\
**Post date:** [August 5, 2019, 10:16am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/17 "2019-08-05T10:16:39Z")

</div>

I really hope you find out what it was. Let me know if you need me.

---

<div class="post-metadata">

**Author:** ![webrocker](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/webrocker/32/4839_2.png) [@webrocker](https://forum.getkirby.com/u/webrocker)\
**Post date:** [August 5, 2019, 11:22am UTC](https://forum.getkirby.com/t/template-for-subpage-is-not-selectable/15153/18 "2019-08-05T11:22:41Z")

</div>

Ok. Of course this issue has nothing to do with Kirby.  
There’s a left-over rewrite rule from the old website that handles requests to “blog” URLs.  
This seemingly clashed with the ajax-request from the panel - and only to “blog” requests, hence the problem with my “blog” blueprint/template, and only on the first level of nesting.  
d’oh. stupid tom, stupid. 🙂  
Thanks for the support, however \<3
