I tried that:
config.php
'routes' => [
[
'pattern' => 'mitglied/(:any)',
'action' => function($user) {
$site = kirby()->site();
return tpl::load(kirby()->roots()->templates() . DS . 'member.php', array('user' => $user, 'site' => $site), false);
}
]
],
template collection of users
<?php foreach($kirby->users()->sortBy('name','asc') as $user):
if($user->member_type() == "member"): ?>
<article class="grid-col-30">
<a href="mitglied/"<? echo $user->id() ?> >
<h2><?php echo $user->member_type() ?></h2>
<h2><?php echo $user->name() ?></h2>
</a>
</article>
<?php endif ?>
<?php endforeach ?>
and added the dir content/member
what do I have to use the correct url to display a user page?
<a href=“mitglied/”<? echo $user->id() ?> >
maybe it’s simpler (with my knowledge) to switch between user collection and singel user with JS