Building user profile pages in Kirby 3

Thanks @texnixe

I had tried something like that.

In any case when I do a var_dump the info is better!

This is what I get when I do:

          array(3) {
  array(4) {
    string(1) "0"
    string(73) "Après avoir roulé depuis 2017 seul, je découvre le club."
    array(1) {
      array(5) {
        string(21) "Adhésion au club ACM"
        string(10) "2021-06-11"
        string(26) "City"
        string(0) ""
        array(0) {
.... and more

In my template I have the foreach loop but when I do for example $item->social_events_date()

              $items = $page->social_events_listing();
              foreach ($items as $item): 

Call to a member function social_events_date() on array

This is missing the toStructure field method!

Exactly !

Thanks a lot

$items = $page->social_events_listing()->toStructure()->flip();

Getting back to the model.

I recovered the slug to be able to make a link in my pages of the members.

I would like to know if my url is well optimized?

<a href="membres/<?= Str::slug($user->firstname() ." ". $user->namefamily()) ?>"><?= $user->firstname() ?> <?= $user->namefamily() ?></a></div>

the url of my page is of this type:

other solution:

<a href="<?= $site->url() ?>/club/membres/<?= Str::slug($user->firstname() ." ". $user->namefamily()) ?>"><?= $user->firstname() ?> <?= $user->namefamily() ?></a></div>

Can we do better to avoid having to write /club/members ?

I’m missing a bit of context here. Why do you want to create these links manually? All the subpage have a normal URL now.

foreach (page('membres')->children() as $member) {
   echo $member->url();

Or if you want to fetch a particular memberpage

if ($member = page('membres')->children()->findBy('slug', 'john-doe')) {
  echo $member->url();

Don’t know if that answers your question, otherwise maybe rephrase your question and provide more context. Thanks!