Modular sections

First of all, I love kirby and its philosophy. The community and support is great. I also loved Bastian’s videos, because they showcased the “kirby way” of doing things, which saves a lot of time.

This is kind of compounded question, so bear with me. It’s also why I can’t properly search for it.

Say I want to build a portfolio page and each project could have: an intro text section (with client fields etc), then an image gallery section, a two-image comparison section and another text.

See for example this page. Which is quite easy to achieve in a template, if the fields are always these and in this order.

But if I want each project to be dynamic and have more than one instances of these sections or skip some or have them in a different order, what are my options?

  1. Have these sections in subpages with their respective templates and render it by getting each project’s children?
  2. Have a single page template and in the blueprint have a structure with conditional fields, where the user can add sections and have them conditionally formatted with if-elseif in the template?
  3. Make a plugin for each section?

What do you think is the best course of action? Or better yet, which is the most “native” way to approach this?
I would think (1) but none of these solutions seem to be very client-friendly…

Thanks in advance.

Two more ways spring to mind here.

4… Use Kirby Builder https://github.com/TimOetting/kirby-builder

5… make custom blocks for the Editor https://github.com/getkirby/editor

1 Like

YES! That what I was looking for! :partying_face: :partying_face:
Thanks so much!

Why are these not so well-known?

Both are in the Plugin directory Plugins | Kirby CMS

1 Like