I am having an issue on a site build, which I have replicated in the Starterkit.
I have a pages section in site.yml, which is set up like so:
pages:
type: pages
label: Website pages
help: These are the main, top-level pages of the website. You can change their status here, and also drag to change their order in the navigation
image:
back: white
query: icon
create:
- default
- news
- contact
- services
templates:
- home
- default
- news
- contact
- services
The home.yml template has sort: false set on it, as I want it to always be at the top of this listing and be unmoveable from there. All the others I would like the editor to be able to drag around, all the while leaving home at the top. I have set the home folder to be 0_home to make sure it sticks there.
However when I drag the other pages I am getting some wierd reordering, and an error that home can not be sorted.
I may be doing something wrong here, but I can’t work out how to get this working how I woule like it to?
TLDR: Can I have a sortable pages section, with the home page stuck at the top and not part of the sorting?
The pages in a section are either sortable or not, so it doesn’t make sense to set one of them to unsortable. The only option to exclude the home page from sorting, would be to make it unlisted, but then it wouldn’t be attached to the top.
It’s odd because I had exactly the same setup in a Kirby 4 site and it worked exactly as I needed - the homepage sat at the top, with sort: false set in its blueprint. Then sortable blueprint pages beneath it. I like it as it mirrors what the site navigation looks like for the client, and keeps the homepage at the top.
Looking at the Kirby 4 project I actually set home as 1_home, but this doesn’t work in Kirby 5 either. It’s not a huge deal, but it would be good to keep using the same setup if possible.
I added num:0 to the home blueprint and that seems to have successfully stuck it to the top of the section. But I am seeing some odd drag behaviour when reordering the other pages, I need to drag the page handle into the list rather than just up and down to get it to work.