Next.js Discord

Discord Forum

Structuring routes with multiple options and generateStaticParams

Unanswered
Gharial posted this in #help-forum
Open in Discord
GharialOP
Hey everyone - question about showing multiple options when generating static content.

Right now, I'm have a route showing data for an item in my mongodb datbase. Let's say there's there an ID, collection, and a translator object that may have one or 2 tranlators, each with a content key/value. Currently, I'm rendering translator[0].content. I'm wondering what the best approach would be to show the option to click to translator[1].content on the page? Right now the route is something like /collection/itemId with a catchall.

Since it's static, I'm trying not to make it a client component and use useEffect. I'm thinking I could just build the translator into the url so it's something like collection/itemId?translator. Would that work? Is there a better approach?

Thanks!

0 Replies