Kirby 3.8.2
PHP 8.0
Thanks, I’ll look at the documentation.
It probably bug because it tries to list users?
I used the following example:
<?php
class MembersPage extends Page
{
public function children()
{
$usersPages = [];
$users = kirby()->users();
foreach ($users as $key => $user) {
$userPages[] = [
'slug' => Str::slug($user->firstname() ." ". substr($user->id(), 0, 3)), // or username if unique
'num' => $user->indexOf($users),
'template' => 'member',
//'model' => 'members',
'member_url' => $user->firstname() ." ". $user->namefamily(),
'content' => [
'user' => $user,
'name' => $user->name(),
'title' => $user->firstname() ." ". $user->namefamily(),
'firstname' => $user->firstname(),
'namefamily' => $user->namefamily(),
'member' => $user->member(),
'sex' => $user->sex(),
'birthday' => $user->birthday(),
'street' => $user->street(),
'zip' => $user->zip(),
'city' => $user->city(),
'country' => $user->country(),
'phone' => $user->phone(),
'phonemobile' => $user->phonemobile(),
'licence_date' => $user->licence_date(),
'size' => $user->size(),
'weight' => $user->weight(),
'bio' => $user->bio(),
'url_strava' => $user->url_strava(),
'photo' => $user->file(),
// Options du select
'options' => $user->blueprint()->field('sex'),
// Structure
'social_events_listing' => $user->social_events_listing()->toStructure()->toArray(),
// more fields here
]
];
}
return Pages::factory($userPages, $this);
}
}