Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Get other data of other languages in the same request

default discord avatar
wiesson2 years ago
1

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/2386
  • default discord avatar
    tinouti2 years ago

    Responded on Github! 🙌 ✅

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.