I want to enable my client to create new subpages within the site. As I am using snippets and not templates, like suggested in the cookbook, it does not seem to work like I thought it would.
There are several threads about the topic already, suggesting to use intendedTemplate
but the solution didn’t work for me / I didn’t understand it.
Lets say this is my content folder (I have no sub-folders within the content folder)
1_adventure
adventure.txt
2_super_adventure
adventure.txt
3_about
about.txt
4_general
general.txt
5_even_more_adventures
adventure.txt
I want 1_adventure, 2_super_adventure, 5_even_more_adventures
to use the same blueprint and php-snippet.
This php code from the cookbook worked until I noticed that I could re-use the snippets…
<?php foreach($pages->listed() as $section) {
snippet($section->uid(), ['data' => $section]);} ?>
Using intendedTemplate
like below results in a empty page
foreach(page('home')->children() as $section) {
snippet($section->intendedTemplate()); } ?>
So how to fix this last snippet?
Thanks in Advance!