I have a selection of category groups as follows:
Suitability
Colour
Finish
etc
They all have many categories within them. I have set up some routes for /suitability
etc to show the user a /shop/category.twig
template for the category group landing pages.
But my issue I'm having is getting the context of the page based on the slug.
I have read a very old SE post that kind of offers a solution, but it's only useful for getting the name. I need to build on this to get the group. But it doesn't look like there's a way to 'get' a category group.
I may be wrong and missed something but I've only found ways to obtain category group info based on context of a category itself as follows:
{# get the category group slug #}
{% set slug = craft.app.request.segment(1) %}
{# get the first category within this group and output the groups' name #}
{% set catGroupName = craft.categories.group(slug).first.group %}
Any advice on a much neater way to obtain a category group would be handy. Thanks