Hey!
We have a mutli-language website we are currently building and we have slugs in multiple languages (en-US, en-DE and de-DE) I’m now looking for an API Query to pass which is basically looking for a matching slug in either of those languages (preferably the currently visited language first and afterwards the fallback). So basically I just want to apply the regular fallback logic also to the Query params. I tried various options but can’t find a solution to this problem, does any know if it’s possible?
Example set up: (en-US is the default and both en-DE and de-DE have en-US as the fallback)
- slug en-US: “english-article”
- slug en-DE: “”
- slug-de-DE: “german-article”
Now I want to use the de-DE slug to get to the sys.id:
.../entries?content_type=article&fields.slug[in]=german-article
.../entries?content_type=article&fields.slug.de-DE[in]=german-article
^ The first one doesn’t work, but the second one does. So far so good.
What now happens though if I use the same logic with the locale en-DE is that it’s breaking because I specifically told it to look in the en-DE, but it’s empty. Now only the first one works.
.../entries?content_type=article&fields.slug[in]=english-article
.../entries?content_type=article&fields.slug.en-DE[in]=english-article
So in theory I would love to have a logic like this:
.../entries?content_type=article&fields.slug[en-US,en-DE][in]=english-article
or
.../entries?content_type=article&fields.slug[en-US,de-DE][in]=german-article