# Change url appendix

**URL:** <https://forum.getkirby.com/t/change-url-appendix/25703>\
**Category:** Questions\
**Tags:** v3\
**Created:** [June 9, 2022, 7:05am UTC](https://forum.getkirby.com/t/change-url-appendix/25703 "2022-06-09T07:05:18Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![nirsh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/nirsh/32/11552_2.png) [@nirsh](https://forum.getkirby.com/u/nirsh)\
**Post date:** [June 9, 2022, 7:05am UTC](https://forum.getkirby.com/t/change-url-appendix/25703/1 "2022-06-09T07:05:18Z")

</div>

Hi!  
I’m building a site that is in Hebrew. Therefore every time a user create a page he needs to add the URL appendix manually, because the titles are always in Hebrew.

I’m wondering if there’s a way to give each page a url automatically - like a number or something (I don’t care for the appearance in the url bar, it can be anything).

I found [this thread](https://forum.getkirby.com/t/create-page-slug-from-two-fields/18704/2) but it seems that it only lets me take a different input and make it as a slug. But there are no inputs in english in my site.

Any idea how I can achieve this?  
🙏

---

<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 9, 2022, 7:07am UTC](https://forum.getkirby.com/t/change-url-appendix/25703/2 "2022-06-09T07:07:03Z")

</div>

The slug should be auto-converted from the title? Why do you have to enter them manually?

Have you set the locale for the slug? [slugs | Kirby CMS](https://getkirby.com/docs/reference/system/options/slugs)

---

<div class="post-metadata">

**Author:** ![nirsh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/nirsh/32/11552_2.png) [@nirsh](https://forum.getkirby.com/u/nirsh)\
**Post date:** [June 9, 2022, 7:26am UTC](https://forum.getkirby.com/t/change-url-appendix/25703/3 "2022-06-09T07:26:53Z")

</div>

Thanks! I tried it now. like this:

```auto
return [
    'slugs' => 'he'
];

```

but it’s not working  
I thought that maybe because it’s in Hebrew (rtl) it doesn’t work.

and yes - right now I have to enter the url manually because when I write the title of the page in hebrew it doesn’t auto-convert it to url. it keeps it blank.

---

<div class="post-metadata">

**Author:** ![rasteiner](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/rasteiner/32/4788_2.png) [@rasteiner](https://forum.getkirby.com/u/rasteiner)\
**Post date:** [June 9, 2022, 9:41am UTC](https://forum.getkirby.com/t/change-url-appendix/25703/4 "2022-06-09T09:41:51Z")

</div>

There doesn’t seem to be a hebrew ruleset for the slug generator: [kirby/i18n/rules at main · getkirby/kirby · GitHub](https://github.com/getkirby/kirby/tree/main/i18n/rules)

---

<div class="post-metadata">

**Author:** ![nirsh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/nirsh/32/11552_2.png) [@nirsh](https://forum.getkirby.com/u/nirsh)\
**Post date:** [June 9, 2022, 11:10am UTC](https://forum.getkirby.com/t/change-url-appendix/25703/6 "2022-06-09T11:10:22Z")

</div>

I see now what you mean - Thanks!  
I was wondering if there’s a way to give a slug to a page without the field that converts the title automatically - maybe an external code that gives each page a number as a slug ?

---

<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 9, 2022, 11:16am UTC](https://forum.getkirby.com/t/change-url-appendix/25703/7 "2022-06-09T11:16:40Z")

</div>

You could use the Custom Add fields plugin: [Custom Add Fields | Kirby CMS](https://getkirby.com/plugins/steirico/custom-add-fields)

---

<div class="post-metadata">

**Author:** ![nirsh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/nirsh/32/11552_2.png) [@nirsh](https://forum.getkirby.com/u/nirsh)\
**Post date:** [June 9, 2022, 11:41am UTC](https://forum.getkirby.com/t/change-url-appendix/25703/8 "2022-06-09T11:41:54Z")

</div>

Thank you!  
If I understand correctly - I would then still need the user to fill in a field that will provide the slug. isn’t it?

I found [this](https://forum.getkirby.com/t/create-page-slug-from-two-fields/18704) and here he takes an existing field and use it as a slug - but unfortunately I have no unique fields in english.

---

<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 9, 2022, 11:43am UTC](https://forum.getkirby.com/t/change-url-appendix/25703/9 "2022-06-09T11:43:34Z")

</div>

You don’t need a field, you can just use the current date and time if you want.

But the plugin already handles this: [GitHub - steirico/kirby-plugin-custom-add-fields: Custom fields for Kirby's add dialog.](https://github.com/steirico/kirby-plugin-custom-add-fields#slug-handling)

---

<div class="post-metadata">

**Author:** ![nirsh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/nirsh/32/11552_2.png) [@nirsh](https://forum.getkirby.com/u/nirsh)\
**Post date:** [June 9, 2022, 1:02pm UTC](https://forum.getkirby.com/t/change-url-appendix/25703/10 "2022-06-09T13:02:30Z")

</div>

Thanks!

I added the plugin and also added a file ‘event.php’ inside /site/models that has this code:

```auto
<?php
class Event extends Page {
    public static function hookPageCreate($page){
        
                // get value of add field remoteUrl
                $remoteUrl = $page->remoteUrl()->value();

                // fetch remote content
                $content = file_get_contents($remoteUrl);
        
                // update page field content
                $page->update(array(
                    'content' => $content
                ));
        
                // set slug according to add field title
                $page->changeSlug(Str::slug($page->title()->value()));
    }
}

```

I guess I need to change this code but how?  
I tried to change the last line to:

```auto
$page->changeSlug(Str::slug($page->date()));

```

But it didn’t work. now when I try to add an event - after I write the title it just closes the dialog box - it doesn’t take me to the event page at all

I’m clueless and would love know what are the next steps.  
Thanks a lot

---

<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 9, 2022, 4:04pm UTC](https://forum.getkirby.com/t/change-url-appendix/25703/11 "2022-06-09T16:04:01Z")

</div>

Don’t know why you would have to add that method, but must admit that I haven’t used the plugin in a while. I’ll try to check it out.

---

<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 9, 2022, 5:58pm UTC](https://forum.getkirby.com/t/change-url-appendix/25703/12 "2022-06-09T17:58:23Z")

</div>

Ok, I tested it again. Let’s say you had installed the plugin in a starterkit. Then in the note.yml blueprint you would just add the title field as add-field:

```auto
addFields:
  title:
    label: Title
    type: text
    required: true
    icon: title

```

This will make the create page dialog look like this:

 ![Screen Shot 2022-06-09 at 19.56.59](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/6/6ac2bea966ae2c45274d8e57c6146312e78f23be.png)

And the page is automatically created with the current timestamp as slug:

![Screen Shot 2022-06-09 at 19.57.34](https://europe1.discourse-cdn.com/flex017/uploads/getkirby/original/2X/7/7ae85f5faf3139397ec404e728ca25d0829769e2.png)

If that’s all you need, you are good to go. No model required.

---

<div class="post-metadata">

**Author:** ![nirsh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/nirsh/32/11552_2.png) [@nirsh](https://forum.getkirby.com/u/nirsh)\
**Post date:** [June 10, 2022, 5:19am UTC](https://forum.getkirby.com/t/change-url-appendix/25703/13 "2022-06-10T05:19:33Z")

</div>

Thank you so much! - Your’e right, I don’t need the method - it works without it.  
Im still having a small problem with that: after I click on ‘create draft’ in the dialog box it just shuts the dialog box but it doesn’t take me to the ‘note page’.

I just see the new draft in the notes list. If I click on it again it opens the note page.  
This is how it should work? I would love that it will take me to the note page immediately after clicking on ‘create draft’.

Thank you so much for your super kind 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:** [June 10, 2022, 6:25am UTC](https://forum.getkirby.com/t/change-url-appendix/25703/14 "2022-06-10T06:25:31Z")

</div>

> **[GitHub - steirico/kirby-plugin-custom-add-fields: Custom fields for Kirby's...](https://github.com/steirico/kirby-plugin-custom-add-fields#configure-redirects)**
>
> Custom fields for Kirby's add dialog. Contribute to steirico/kirby-plugin-custom-add-fields development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![nirsh](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/nirsh/32/11552_2.png) [@nirsh](https://forum.getkirby.com/u/nirsh)\
**Post date:** [June 10, 2022, 7:53am UTC](https://forum.getkirby.com/t/change-url-appendix/25703/15 "2022-06-10T07:53:54Z")

</div>

works!  
Thank you so much!  
I truly appreciate your amazing help 🙏
