Child-pages not diplayed

I’m working on a site where every child-folder (section) creates a new section on the current page (parent).
I’ve tried to setup a structure like this:

01-parent
— 01-section
— 02-section
— 03-section

Is there a way to use the same name multiple times in kirby (im not using those section pages with an url) Would be easy to implement different snippets base on page uid().

That is not possible under the same parent, unless maybe if you don’t use the Panel (never recommended). But where’s the point if you want to use different snippets anyway and not the same snippet? In order to use the same snippet for different subpages, you might as well choose the correct snippet based on intendedTemplate/blueprint name or anything else these subpages share, or even a field where you choose the snippet to use.

Edit: So maybe you can provide at bit more information about what exactly you want to achieve so that we can find the best solution for your problem.

@texnixe thanks for your answer. I found a solution that works for me.

01-parent
— 01-gallery-1
— 02-slideshow-1
— 03-gallery-2

Then i use uid() and strip the bit after the last dash. I then use the snippet based on uid(). So ever “gallery-x” uses the “gallery” snippet and so on. Works well.

<?php foreach( $page->children()->visible() as $section ) : ?>
<?php snippet( substr( $section->uid(), 0, strrpos( $section->uid(), '-' ) ), array('data' => $section) ) ?>
<?php endforeach ?>

Thank you

Well, that’s certainly an option. But if it was for a client, I’d vote for a more robust solution like intendedTemplate(). If the user doesn’t enter the title/uid as expected or changes it somehow, the site might break.

1 Like

Thats a good idea. I hadn’t thought about that. Its way more robust. Thanks