Create Route to filter pages based on field

I am trying to create pages similar to “tag pages” based on a custom field for a product like color(farbe).

The result i want to achieve: tld.com/shop/farbe/blau
if possible to also change “/shop/” to “/produkte/”.

I tried following pattern in the config but it doesn’t seem to work - it is showing all of the products=( Do i also need to add a controller?

   'pattern' => 'shop/farbe/(:any)',
            'action' => function ($farbe) {
                return page('shop')->render([
                    'farbe' => $farbe
                ]);
      }

Many thanks!

Yes, you need a controller that does the filtering, it doesn’t happen automagically:

Thanks for the quick reply @texnixe and the great support. How can i change the route to be instead of /shop/ to /produkte/ ?

well

 'pattern' => 'produkte/farbe/(:any)',