# Changing projects url breaks projects snippet

**URL:** <https://forum.getkirby.com/t/changing-projects-url-breaks-projects-snippet/5379>\
**Category:** Questions\
**Tags:** v2\
**Created:** [October 2, 2016, 6:48pm UTC](https://forum.getkirby.com/t/changing-projects-url-breaks-projects-snippet/5379 "2016-10-02T18:48:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![webcatsolutions](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/webcatsolutions/32/3473_2.png) [@webcatsolutions](https://forum.getkirby.com/u/webcatsolutions)\
**Post date:** [October 2, 2016, 6:48pm UTC](https://forum.getkirby.com/t/changing-projects-url-breaks-projects-snippet/5379/1 "2016-10-02T18:48:27Z")

</div>

Hi,

I’m diving into Kirby to see if I can use it for a client project. I installed the starter kit (2.3.2). The backend looks really awesome and I love the massive amount of documentation.

I played around in the backend panel and noticed that if the URL appendix is changed for the Projects page, the projects.php snippet no longer works due to the uid/id/slug change. The cache folder is empty by the way.

Is there a way for a panel user (i.e. client) to change a page url and after that the related snippet without having to access the site via FTP? Or even better (since my clients are not really into php and html): is there maybe a way that I can trigger for the projects.php snippet to be updated with the new identifyer after a user changes the URL appendix?

Chantal

---

<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:** [October 2, 2016, 7:07pm UTC](https://forum.getkirby.com/t/changing-projects-url-breaks-projects-snippet/5379/2 "2016-10-02T19:07:19Z")

</div>

You can use a variable in the snippet:

```auto
<?php foreach($projects->children()->visible()->limit(3) as $project): ?>

```

And when you call the snippet in the projects.php template, pass the the variable to the snippet:

```auto
<?php snippet('projects', array('projects' => $page)) ?>

```

If you do it this way, the uid of the page is irrelevant. But you will have a problem when the snippet is called in the home.php template. Then you would need another method to find the correct page, e.g. by template.

---

<div class="post-metadata">

**Author:** ![webcatsolutions](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/webcatsolutions/32/3473_2.png) [@webcatsolutions](https://forum.getkirby.com/u/webcatsolutions)\
**Post date:** [October 2, 2016, 7:28pm UTC](https://forum.getkirby.com/t/changing-projects-url-breaks-projects-snippet/5379/3 "2016-10-02T19:28:21Z")

</div>

Hi texnixe,  
thanks for that ☀ - it works (the template code needs an extra ‘)’ to close the snippet call) .

Thanks for the tip on finding the correct page by template (might be something I need to look into for a onepager).

Have a great day!  
Chantal

---

<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:** [October 2, 2016, 7:33pm UTC](https://forum.getkirby.com/t/changing-projects-url-breaks-projects-snippet/5379/4 "2016-10-02T19:33:26Z")

</div>

Yeah, sorry, I always forget my parenthesis when not in my editor …😟

As for finding the page by template:

```auto
$projectsPage = $pages->findBy('intendedTemplate', 'projects');

```

---

<div class="post-metadata">

**Author:** ![webcatsolutions](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/webcatsolutions/32/3473_2.png) [@webcatsolutions](https://forum.getkirby.com/u/webcatsolutions)\
**Post date:** [October 2, 2016, 8:10pm UTC](https://forum.getkirby.com/t/changing-projects-url-breaks-projects-snippet/5379/5 "2016-10-02T20:10:12Z")

</div>

No problem at all 🙂 and thank you very much for the pro-active ‘finding page by template’ help 😌

---

<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:** [October 2, 2016, 8:12pm UTC](https://forum.getkirby.com/t/changing-projects-url-breaks-projects-snippet/5379/6 "2016-10-02T20:12:44Z")

</div>

You are welcome 🙂 We are here to help …

---

<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, 4:55pm UTC](https://forum.getkirby.com/t/changing-projects-url-breaks-projects-snippet/5379/7 "2025-02-06T16:55:06Z")

</div>


