# One-pager with duplicate snippets

**URL:** <https://forum.getkirby.com/t/one-pager-with-duplicate-snippets/1163>\
**Category:** Questions\
**Tags:** v2\
**Created:** [May 23, 2015, 5:08pm UTC](https://forum.getkirby.com/t/one-pager-with-duplicate-snippets/1163 "2015-05-23T17:08:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![criuz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/criuz/32/312_2.png) [@criuz](https://forum.getkirby.com/u/criuz)\
**Post date:** [May 23, 2015, 5:08pm UTC](https://forum.getkirby.com/t/one-pager-with-duplicate-snippets/1163/1 "2015-05-23T17:08:32Z")

</div>

Hi,

I am building a one-pager-template like described here: [[http://getkirby.com/docs/solutions/one-pager](http://getkirby.com/docs/solutions/one-pager)][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?

Best,  
Chris  
[1]: [http://getkirby.com/docs/solutions/one-pager](http://getkirby.com/docs/solutions/one-pager)

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [May 23, 2015, 5:44pm UTC](https://forum.getkirby.com/t/one-pager-with-duplicate-snippets/1163/2 "2015-05-23T17:44:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [May 23, 2015, 6:03pm UTC](https://forum.getkirby.com/t/one-pager-with-duplicate-snippets/1163/3 "2015-05-23T18:03:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![criuz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/criuz/32/312_2.png) [@criuz](https://forum.getkirby.com/u/criuz)\
**Post date:** [May 23, 2015, 7:45pm UTC](https://forum.getkirby.com/t/one-pager-with-duplicate-snippets/1163/4 "2015-05-23T19:45:15Z")

</div>

> [@distantnative](#):
>
> intendedTemplate()

That did the trick! Thanks!

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:17pm UTC](https://forum.getkirby.com/t/one-pager-with-duplicate-snippets/1163/5 "2025-02-06T17:17:19Z")

</div>

Archived on February 6, 2025, 5:17pm UTC


