One-pager with duplicate snippets


I am building a one-pager-template like described here: [][1]
Everything is going well, only I’d love to use a “divider” snippet and reuse it a couple of times.
See my structure here:

I am calling all snippets with this:

<?php foreach($pages->children()->visible() as $section): ?>
<?php snippet($section->uid(), array('data' => $section)); ?>
<?php endforeach ?>

Unfortunately this way only the first “divider-snippet” is rendered. Anyone has an idea how to fix this?


You can’t have multiple folders with the same name on the same level, because only the part without the prepended number is regarded as the folder name. Since the name of the folder determines the URL, you would otherwise end up with the same URL a couple of times.

Depending on the content of the snippet, you can either call the same snippet several times or you would have to rename the snippets, e.g. divider-one, divider-two etc.

If you wanna go for the same snippet, you could name the folders differently, but the containing .txt the same. So you would refer to the same template - and within the one-pager use $page->intendedTemplate() for getting the right snippet.


That did the trick! Thanks!