Hi there
I know that a few other posts with this title exist, but none of them seemed to help me out.
I have currently the case that I create the “home” page with the default.yml blueprint.
Because home is a bit special, I would like to reassign it another template (home.yml) and change the default.yml for all other pages.
I tried to add
options:
changeTemplate: true
no effect.
so I tried:
options:
changeTemplate:
- home
- default
Sidenote:
I have
blueprints/pages/default.yml
and blueprints/pages/home.yml
But this has no effect. The option is always greyed out. (To what is the name of the template option referring to? Is it the filename? Or is it the title? (Which has spaces in my case …)
I then read somewhere that the blueprint changeTemplate options only apply for child pages?!
So I tried adding this codeblock to site.yml. But no effect either.
So I am currently stuck and don’t really know how to solve this.
Also I have to mention that I use Kirby headless, so I don’t mess around with templates.
Thank you in advance. Cheers
true
will not work, but listing out the templates like in this example is correct. Could you please provide more context.
@texnixe I think the home
page is special in terms of changeTemplate
. At least I noticed this a few versions back in a project. It didn’t allow me to use changeTemplate
, no matter what I tried.
Thanks for the replies.
You ask for more context, but I don’t know what else I can give you there :)…
@thguenther I tried to make a new blueprint (archive.yml
), created a new page with this template and also there I can’t select the Change template
option:
Whereas my archive.yml
looks like this:
title: Archive
options:
changeTemplate:
- archive
- default
columns:
main:
width: 1/2
sections:
content:
type: fields
fields:
paragraphs:
label: Archive Entries
type: structure
columns:
title:
label: Exact name of the broadcast
width: 2/8
text:
width: 5/8
inverted:
width: 1/8
fields:
title:
type: text
text:
type: textarea
inverted:
type: toggle
secondary:
width: 1/2
fields:
draggable_images:
label: Draggable Images
type: files
template: default
sortable: true
max: 10
width: 2000
height: 2000
There is a lot of stuff in there that is not important in this matter, I left it in there anyway, for the whole context…
Also I have to mention that I am logged in with a user with Admin rights (unchanged, no admin.yml).
I think I must be missing something… right?
You indentation is not correct, should be
options:
changeTemplate:
- archive
- default
don’t know if that’s a copy paste issue?
1 Like
No the indentation was indeed one off.
Fixing it does not help though.
default.yml
options:
changeTemplate:
- archive
- default
But still:
On my home
…
Oh, hey, but @thguenther’s comment might be correct.
If I fix indentation on my archive.yml I do now have the option to change the template!
So it’ s just special on home then?
Yes, seems like that’s still the case — I just reproduced it.
If you change the home page in the config.php
it won’t work on that page either. So it doesn’t have anything to do with the uid home
.
It probably makes sense the user doesn’t change the home template on 90% of websites. But it would undoubtedly be great if you could overwrite it somehow. What do you think, @texnixe?
1 Like
I didn’t know that was a no-no. But yes, I can definitely see use cases for changing the home page template and don’t know why that shouldn’t be possible.