Pretty new to Sitecore and FED in general. I'm currently trying to solve the following bug that we have:
We have a LanguageSelector
component and the website's default language is English. When we select a language from the dropdown of which the XM Cloud
has no content we get redirected to the 404 Page not found page. Instead, we want to have the English fallback language.
I feel that I should somehow check if we get a 404 page not found error when a different language is chosen hence the const checkContentAvailiblity
, but I'm stuck on how to proceed further.
Is someone able to help out or point me in a different direction? Would be greatly appreciated! Any tips or pointers are welcome!