Hi, I have a hard time wrapping my head around the new blueprint structure and syntax, transitioning from Kirby 2 to 3. My context: I have created several websites in Kirby 2, all with some panel alterations. I have read all the blueprint documentation and looked around in the starterkit.
A few questions regarding the blueprints in Kirby 3 starterkit:
I read in the blueprints 3 different ways to refer to ‘pages’:
pages:
type: pages
preset: pages
What is referencing to what? And what does ‘pages’ mean in each situation?
I read in the site.yml of the Starterkit:
template:
- about
- home
- default Why is this referencing to the template? And what does it do?
I looked into the Starterkit blueprint sections. I’m totally lost… Site.yml refer to the albums like this:
sections:
albums: sections/albums Why does it refer to sections and albums twice?
A quick way to create a page that is mainly a container for subpages (e.g. a blog page)
The template option filters the pages that are shown in the section and only displays those with the given templates/blueprints.
The pages section is defined in /site/blueprints/sections/albums.yml
It queries the parent page, in this case the photography page. The section will then show the children of this page.
photography.yml is the blueprint for the parent page album.yml is the blueprint for the subpages of the photography page albums.yml is the section blueprint, instead of defining it three times in the photographyblueprint, it is “outsourced” and reused: Reusing & extending blueprints | Kirby CMS
Thank you for the quick reply, and helping me out.
The first bullet point (pages: ) is listed in the site.yml like this:
width: 1/2
sections:
pages:
type: pages
create: default
template:
- about
- home
- default
I still don’t understand how the album section is build up. How is the photography page a parent? And if it’s a parent why does it need to be referenced, or searched in the site, because it already is a parent…
Why does the section “albums.yml” need to be there in the first place? Why not list it like this:
sections:
pages:
type: pages
create: album
template:
- album
Well, a section has a name (pages in this case, but you can call it anything), a type (pages in this case, but there are also files sections, fields section or info sections)
It is a parent because it has children (album pages), the logic is the same as in Kirby 2.
I already answered it above, to prevent having to repeat the same stuff over and over again if you want to use the section in multiple places, in this case in the site.yml and in the photography.yml. It keeps your blueprint clean. Of course you don’t have to put the definition into a separate file if you don’t want to, but it is highly recommended.
The section name still feels weird. I read it like “sections: blank” “pages: blank”. Wouldn’t it be easier to read if it stated “sections: pages”?
Anyway, I digress…
Still can’t grasp the section blueprint setup. It’s probably me. I will leave this for now. Always good to have something to learn
Maybe go through the guide step by step again. The blueprint setup in Kirby 3 is more complicated than in Kirby 2, yes, but it gives you a lot more flexibility to create the forms just as your clients need them.