My page has three languages and I'd like to achieve two tasks:
1. Add the canonical url of the other languages.
2. If the user switches the language, use the correct slug to switch to the "same page" in the desired language (if that page is available)
The problem is that each page has a different slug so I have to query the first page by slug, then use the id to query the others.
Question: Is there a simpler method so that I don't have so many queries (at least 2-3 per page and language)?
Posted this question here as well:
https://github.com/payloadcms/payload/discussions/2386Responded on Github! 🙌 ✅
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.