Route not resolving

Hi there,

I am trying to create a virtual page to display a list of pages and filter them by tags.
My problem is, that my defined route is not getting viewed. It always shows me the error page with my default template.

I tried to setup my route via the config.php and a plugin. Both ways didn’t work.

Here is my example code:

Kirby::plugin('tagged', [
'routes' => [
    [
        'pattern' => 'tags/:any',
        'action' => function ($tag) {
            return new Page([
                'slug' => 'tags/:any',
                'template' => 'tags',
                'content' => [
                    'tag' => $tag,
                ],
            ]);
        },
    ],
],

]);

I’m using Laravel valet if that helps.

Thanks for every hint :slight_smile:

should be

'pattern' => 'tags/(:any)',

i.e. with the parens around the placeholder

1 Like

Also, your plugin syntax is missing your name, must be yourname/yourpluginname

1 Like

That was is.
Thanks for the quick help

No problemo. My pleasure.