How are blueprints applied to subpages?

Hello!

Iā€™m relatively new to Kirby and how it works. :face_with_monocle:

Iā€™ve been modifying the starter kit to my liking, but one thing I canā€™t seem to figure out is how to move the notes content under another page as a child and still retain the blueprint. (or even apply another blueprint for that matter)

I would like the notes to function exactly as they do with the exception of itā€™s just underneath a different page/folder. The panel doesnā€™t seem to recognize the notes at all unless I change notes.txt to default.txt. Perhaps the parent blueprint needs to accommodate for this but Im having trouble finding documentation or an example.

Can blueprints only be applied to top-level pages? (my guess is no, but I think Iā€™m missing something) Does the same apply to templates?

Lastly, would it still be possible to list the series of notes on the main panel if the ā€œnotesā€ page is no longer top-level?

thank you!!

Yes, you would have to adapt the notes section (/site/blueprints/sections/notes.yml) and set the parent option to the new parent (currently set to parent: site.find("notes")).

No, of course not. You can have blueprints for pages on all levels, and children in a folder donā€™t have to use the same blueprint. The template/blueprint a page uses is defined in the pages section.

To make the notes parent/children show up in your new parent page, you have to include a pages section in your parentā€™s blueprint.

For example, if you put the complete notes folder into the test folder with a text file test.txt, then in your test.yml you could create a pages section like this:

title: Test

sections:
  notes:
    headline: My Notes
    type: pages
    parent: site.find("test/notes")
    templates: note

This would then list all children of the notes page. With the templates option we define that new children may only be created using the note.yml blueprint.

1 Like