Is there a way to change the URL segment generator mechanism, aka customize the slug algorithm, aka provide your own ToAscii for node names?
We want to turn the URL /räk/smörgås/ into /rak/smorgas/, but the default segment generator turns it into /raek/smoergaas/.
Not quire sure why, since the traditional decomposition for ä is a◌̈ which would remove the diaeresis/trema/umlaut during ascii conversion. Maybe the decomposition is culture specific.
We've had a look at the code that does this, but I can't easily see how to customize the behavior.
Thanks. Just to verify, configuring the Request Handler will change how Umbraco generates URLs as well as how URLs are resolved into documents, i.e. both ways?
Modify URL segment generator mechanism aka customize slug algorithm
Is there a way to change the URL segment generator mechanism, aka customize the slug algorithm, aka provide your own
ToAscii
for node names?We want to turn the URL
/räk/smörgås/
into/rak/smorgas/
, but the default segment generator turns it into/raek/smoergaas/
.Not quire sure why, since the traditional decomposition for ä is
a◌̈
which would remove the diaeresis/trema/umlaut during ascii conversion. Maybe the decomposition is culture specific.We've had a look at the code that does this, but I can't easily see how to customize the behavior.
Using Umbraco v9.2.
Hi,
You are able to influence the URL segment generator through the appsettings. You are able to configure what chars should replace other chars. There is some more documentation about it here: https://our.umbraco.com/documentation/Reference/V9-Config/RequestHandlerSettings/
Thanks. Just to verify, configuring the Request Handler will change how Umbraco generates URLs as well as how URLs are resolved into documents, i.e. both ways?
Yes, that is correct
I can't get this to work. I've configured like so:
However, an "å" in a node name is still turned into "aa", both in Admin in the URLs list for an item and on the front-end. The URL with "a" is a 404.
Schema validation says the configuration is valid. There are no errors or warnings on startup. The
AddTrailingSlash
setting is applied correctly.Is there something else needed for the char replacements to take effect?
EDIT: Sorry, just noticed this has been broken since 9.0 and will be fixed in 9.3.0 which seems due in a few days.
EDIT: Working fine in 9.3.
is working on a reply...