Next.js Discord

Discord Forum

Help with Next.js Strapi - building query string for filtering blogs by category and tags

Unanswered
Almond stone wasp posted this in #help-forum
Open in Discord
Almond stone waspOP
I am using next.js app router and strapi for my CMS. My application has a blog and I want to be able to filter my blogs by category and tags. I want the category/tags to be in my url as search params. I know how to use query params for my fetch to strapi but I am having a really hard time figuring out where to start on the next side. I want this to be SEO.

Where do I start? Next.js searchParams? Does anyone have a example of this?

Ideally when user clicks on category and or tags I want my url to be like this: /api/blogs?category=cybersecurity&tags=jobs and then fetch the data from Strapi.

Thank you

0 Replies