So my client wants to have some settings that can be enabled or disabled, for example a side-wide alert on the top of each page. As a first-time-user I read here that the settings page in Kirby isn’t actually for settings (lol). So it made sense to add tabs to the panel. First tab would be the regular ‘drafts’, ‘unlisted’, ‘listed’ pages. And the other tab would only contain switches or other side-wide settings.
My blueprints/site.yml currently looks like this:
title: Site
preset: pages
pages: true
options:
url: true
tabs:
content:
unlisted:
headline: Pages not in menu
info: '{{ page.slug }}'
listed:
headline: Pages in menu
info: '{{ page.slug }}'
drafts:
settings:
label: test
icon: search
type: fields
fields:
alert_show:
label: Show alert
type: toggle
text: Show alert
[...]
But when I upload it like that, no tabs show up and the ‘unlisted’ category is gone?
So then I tried to give up on the idea to have tabs, since the documentation is quite unclear about that. So I tried to add the fields to the main panel, above the categories. So I changed the lower part of the site.yml:
drafts:
unlisted:
headline: Pages not in menu
info: '{{ page.slug }}'
listed:
headline: Pages in menu
info: '{{ page.slug }}'
settings:
type: fields
fields:
alert_show:
label: Show alert
type: toggle
text: Show alert
[...]
But then, the settings part doesn’t show up at all! So then I tried removing ‘drafts’ and renaming ‘settings’ to ‘drafts’. And guess what? Drafts does hide, and all settings show up!
To clarify what I did, here the final file which does show my fields, but now hides ‘drafts’:
unlisted:
headline: Pages not in menu
info: '{{ page.slug }}'
listed:
headline: Pages in menu
info: '{{ page.slug }}'
drafts:
type: fields
fields:
alert_show:
label: Show alert
type: toggle
text: Show alert
It seems as if ‘drafts’, ‘listed’ and ‘unlisted’ is declared somewhere. Since if I make my own section and call it ‘settings’ it doesn’t show up.
Can someone explain to me how this works or at least point me in the right direction (documentation wise)?
Thanks!