# Set page URL in YAML?

**URL:** <https://forum.getkirby.com/t/set-page-url-in-yaml/10572>\
**Category:** Questions\
**Tags:** v2\
**Created:** [June 5, 2018, 4:01pm UTC](https://forum.getkirby.com/t/set-page-url-in-yaml/10572 "2018-06-05T16:01:39Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrolling](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/patrolling/32/5470_2.png) [@patrolling](https://forum.getkirby.com/u/patrolling)\
**Post date:** [June 5, 2018, 4:01pm UTC](https://forum.getkirby.com/t/set-page-url-in-yaml/10572/1 "2018-06-05T16:01:39Z")

</div>

I’m new to Kirby, working on setting up a personal website to share some writing and a work portfolio. I’ve worked with other static site generators in the past–Pelican and Jekyll–which have their own learning challenges.

With minimal programming knowledge and a love of Markdown, I would rather create and edit pages as text files than by customizing and using the panel. In the panel, changing the URL of a page is simple. Is there a way to set the URL with a field in the YAML of a project.txt (or other page) file?

---

<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:** [June 5, 2018, 4:09pm UTC](https://forum.getkirby.com/t/set-page-url-in-yaml/10572/2 "2018-06-05T16:09:59Z")

</div>

You could achieve that, but this would only work and make sense if you use a custom URL method in combination with routes.

So instead of using the standard url() method to create your links within the page, you would use a custom page method that generates the URL from that field. And then in your router, you would find the page by that field as well.

Why not rename the page folder instead?

---

<div class="post-metadata">

**Author:** ![patrolling](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/patrolling/32/5470_2.png) [@patrolling](https://forum.getkirby.com/u/patrolling)\
**Post date:** [June 5, 2018, 4:32pm UTC](https://forum.getkirby.com/t/set-page-url-in-yaml/10572/3 "2018-06-05T16:32:14Z")

</div>

Thanks. It looks like I should name folders instead, though I’m still trying to understand the folder structure for Kirby. One of the projects in my portfolio is “Classes and Talks.” I’m sharing a brief description and some slides as examples, and I’d like to have a separate page for each example.

If I create a folder inside the “1-classes-talks” folder, the subfolder doesn’t seem to generate a page in that directory (or at all?). In the panel, I think I created a page inside the projects folder, which allows me to create subpages. Here’s the folder structure I now have for a talk on e-readers:

```
1-projects
    1-classes-talks
    classes-talks
        1-e-readers

```

The resulting URL is “/projects/classes-talks/e-readers” which is what I’d like to have. It’s not how I thought folders would be nested.

---

<div class="post-metadata">

**Author:** ![manuelmoreale](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/manuelmoreale/32/839_2.png) [@manuelmoreale](https://forum.getkirby.com/u/manuelmoreale)\
**Post date:** [June 5, 2018, 4:41pm UTC](https://forum.getkirby.com/t/set-page-url-in-yaml/10572/4 "2018-06-05T16:41:37Z")

</div>

it’s either this

```auto
1-projects
    1-classes-talks
        1-e-readers

```

or this

```auto
1-projects
    classes-talks
        1-e-readers

```

In both cases you’ll have a url that looks like this `projects/classes-talks/e-readers`

I could be wrong, but if I remember correctly, the sorting number doesn’t really have anything to do with the visibility of a page which is why you can’t have two folders with the same name inside the same parent folder

---

<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:** [June 5, 2018, 5:54pm UTC](https://forum.getkirby.com/t/set-page-url-in-yaml/10572/5 "2018-06-05T17:54:41Z")

</div>

Prepended numbers are only a visibility flag you can use for several use cases, they don’t really mean anything regarding the accessibility of a page in the browser. The number is ignored in page urls (but used in links to files).

What @manuelmoreale said above is correct. From a Kirby perspective, you can’t have `1-projects` and `projects`, both pages would have the same URL.

Apart from that, each folder name is a separate URL, so the folder /content/projects would result in `https://domain.com/projects` etc.

---

<div class="post-metadata">

**Author:** ![patrolling](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/patrolling/32/5470_2.png) [@patrolling](https://forum.getkirby.com/u/patrolling)\
**Post date:** [June 5, 2018, 6:42pm UTC](https://forum.getkirby.com/t/set-page-url-in-yaml/10572/6 "2018-06-05T18:42:13Z")

</div>

Thanks to you both. I’m so new to Kirby, I probably missed something basic in what I was doing.

---

<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:** [June 5, 2018, 7:21pm UTC](https://forum.getkirby.com/t/set-page-url-in-yaml/10572/7 "2018-06-05T19:21:25Z")

</div>

No problem, we are here to help. I think the Starterkit is a good starting point to get an idea how it works. Also the [Getting Started](https://getkirby.com/docs/getting-started) guide.

---

<div class="post-metadata">

**Author:** ![patrolling](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/patrolling/32/5470_2.png) [@patrolling](https://forum.getkirby.com/u/patrolling)\
**Post date:** [June 6, 2018, 1:58pm UTC](https://forum.getkirby.com/t/set-page-url-in-yaml/10572/8 "2018-06-06T13:58:00Z")

</div>

Yes, I’m editing files in the Starterkit to do my first tests. That’s why I’m renaming some pages and sorting out what information to put in the txt files. I can see I’m going to have a lot of files named article.txt, project.txt, 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:** [February 6, 2025, 5:28pm UTC](https://forum.getkirby.com/t/set-page-url-in-yaml/10572/9 "2025-02-06T17:28:03Z")

</div>


