Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi,
I believe you can set the UrlSegment.URLCharacterMap to override the replacement characters, no? It's just a Hastable with set access.
Regards.
/Q
Hi Quan,
I tried that, but if i add/change to a string instead of a char as replacement, I get a cast exception later on.
/Erik
I guess it's in internal static string ReplaceIllegalChars(string inputString) it happens.
Hi,
The URLCharacterMap.URLCharacterMap is a public static property. You could try to setup it somewhere in your bootstraper.
Hmm, so instead of mapping character-character you want character-string instead.
I have tried yet but I think you can overwrite the default ContentProvider.GetUniqueUrlSegment and do the stuff here. It calls to UrlSegment.GetUrlFriendlySegment, which unfortunately un-overridable.
Just not sure if this approach is even nastier than yours :).
Regards.
/Q
Hmm, so instead of mapping character-character you want character-string.
I have tried yet but I think you can overwrite the default ContentProvider.GetUniqueUrlSegment and do the stuff here. It calls to UrlSegment.GetUrlFriendlySegment, which unfortunately un-overridable.
Just not sure if this approach is even nastier than yours :).
Regards.
/Q
Hehe, I think I'll stick to the current solution. It ignores ä,ö,ü and ß in the character mapping, then in UrlSegment.CreatedUrlSegment I replace them myself with ae, oe, ue and ss.
/Erik
Hi,
we need to have different mappings for the urlsegment depending on which language is edited. Is there a way to configure this somehow? And also, is there a way to add like "oe" as replacement for "ö"? Today UrlSegment.URLCharacterMap is a char[,] which means that's a problem.
Thanks,
Erik
Ps. I have solved this issue with some nasty code, just want to know if there is a best practice I'm missing out on.. :)