I forgot to say that I basically have everything as it is in your linked thread. Well, it works on routing. But only not if an umlaut is in the category. There I get the error that the pages cannot be found. With other categories I get the articles from the category displayed.
But with the urlencode the link looks like it is broken.
'routes' => [
[
'pattern' => 'blog/(:any)',
'action' => function ($category) {
if (in_array($category, page('blog')->children()->listed()->pluck('category', ',', true))) {
// if that is the case, we return a virtual page
return Page::factory([
'slug' => $category,
'template' => 'category',
'model' => 'category',
'content' => [
'title' => 'Alle Artikel in ' . '<span class="t-text-focus">' . ucfirst($category) . '</span>',
]
]);
}
$this->next();
}
]
]
