I've set up a power pages site from the blank template and done no customisation other than adding two additional languages.
I have a scenario where a query string parameter needs to be appended to the site/page address.
This all works fine except that when switching from one language to another using the switcher drop down on the site, it will url encode the query string, including the ? mark, which then results in an ASP.NET error. I disabled custom errors on the site to show the full exception message.
I raised a ticket with MS and they confirmed a recent change has resulted in this default behavior.
The good news is that it can be switched off with a portal site setting called Site/EnableLanguageDropUrlEncoding.
Set to false to switch off the encoding.
This seems to be a recently introduced issue with the language.url_substitution liquid object. I've been able to fix it in a hacky way using the language.code and request.url liquid objects (removing the domain from request.url):
href="/{{ language.code }}{{ request.url | remove: "domain/en-US" | remove: "domain/fr-FR" }}
This seems to return the correct URL for language switching.
Correction: This didn't actually work. Had to go with some Javascript function to change the href.
Yep it's all working without the additional query parameter.
When hovering on the link, you can see its encoded there. The rendered link in devtools shown
Feels like I may have to hack it with some javascript until this gets fixed.
Fubar
69
Super User 2025 Season 1
oliver.rodrigues
49
Most Valuable Professional
Jon Unzueta
43