# Auto-append to URL-Appendix

**URL:** <https://forum.getkirby.com/t/auto-append-to-url-appendix/19722>\
**Category:** Questions\
**Tags:** v3\
**Created:** [October 11, 2020, 4:33am UTC](https://forum.getkirby.com/t/auto-append-to-url-appendix/19722 "2020-10-11T04:33:52Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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 11, 2020, 2:04pm UTC](https://forum.getkirby.com/t/auto-append-to-url-appendix/19722/4 "2020-10-11T14:04:53Z")

</div>

> [@demlak](#):
>
> is it possible to also see this in the preview area while creating the page? currently the preview is generated live from title while entering title

No, because this happens when the page is actually created, not in the create page dialog. The dialog is client side, the model is server-side code.

Maybe you also want to add a condition to only execute this if the slug is already taken?

And instead of always creating the slug from the content title, you might want to use the slug the user created, so

```auto
 if ( page( $props['slug'] ) ) {
   $props['slug'] = $props['slug'] . "-" . Str::random(3);
}

```

---

_[View the full topic](https://forum.getkirby.com/t/auto-append-to-url-appendix/19722)._
