# User profiles on front end

**URL:** <https://forum.getkirby.com/t/user-profiles-on-front-end/29727>\
**Category:** Questions\
**Created:** [October 11, 2023, 2:31pm UTC](https://forum.getkirby.com/t/user-profiles-on-front-end/29727 "2023-10-11T14:31:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikeharrison](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mikeharrison/32/9620_2.png) [@mikeharrison](https://forum.getkirby.com/u/mikeharrison)\
**Post date:** [October 11, 2023, 2:31pm UTC](https://forum.getkirby.com/t/user-profiles-on-front-end/29727/1 "2023-10-11T14:31:44Z")

</div>

Hi,

I have a set of Kirby users, and would like to show their profiles as pages on the front end of the website. I have a listing page (`/creators`) that I would like to be the parent of these pages. So for the child pages I would like to have `/creators/user-name-uuid` as the url.

What is the best way to approach this? Is it a route using virtual pages, or is there a better way?

Also, I am guessing I will need to include the uuid of the user in the url to avoid issues with people with the same name, is there any security implication to doing this?

Thanks for your thoughts!

---

<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, 2023, 2:51pm UTC](https://forum.getkirby.com/t/user-profiles-on-front-end/29727/2 "2023-10-11T14:51:50Z")

</div>

> [@mikeharrison](#):
>
> Is it a route using virtual pages, or is there a better way?

No, not a route, but a model for the creators page where you define the user profiles as children

---

<div class="post-metadata">

**Author:** ![mikeharrison](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/mikeharrison/32/9620_2.png) [@mikeharrison](https://forum.getkirby.com/u/mikeharrison)\
**Post date:** [October 11, 2023, 7:10pm UTC](https://forum.getkirby.com/t/user-profiles-on-front-end/29727/3 "2023-10-11T19:10:27Z")

</div>

Great, thanks for the pointer.

This is what I have landed with:

```auto
<?php

use Kirby\Uuid\Uuid;

class CreatorsPage extends Kirby\Cms\Page
{
    public function children(): Pages
    {
        if ($this->children instanceof Pages) {
            return $this->children;
        }

        $creators = [];

        foreach (kirby()->users()->filterBy('role','member') as $creator) {
            $creators[] = [
                'slug' => Str::slug($creator->profileName()) . '-' . $creator->uuid()->id(),
                'num' => 0,
                'template' => 'creator',
                'model' => 'creator',
                'content' => [
                    'title' => $creator->profileName(),
                    'uuid' => $creator->uuid()->id(),

                ]
            ];
        }

        return $this->children = Pages::factory($creators, $this);
    }
}

```

Which does the job of setting up the urls as I would like, and also passing the uuid from the user as part of the content means I can find all the rest of the user data on the individual creator page like this:

```auto
<?php
$creator = $kirby->users()->find($page->uuid()->id())
?>

```

Super simple and works a treat.

I ❤ Kirby sometimes
