AI OnAI Off
UrlResolver.GetUrl ?
Something like:
foreach(var lang in currentPage.ExistingLanguages)
{
var langPrefix = lang.ToString();
var url = UrlResolver.Current.GetUrl(currentPage.ContentLink, langPrefix);
}
If you need absolute urls you can use the current sitedefinition like: (I'm using the Flurl nuget package to combine urls to avoid handling all the slashes etc)
var currentSitePath = SiteDefinition.Current.SiteUrl;
foreach (var lang in currentPage.ExistingLanguages)
{
var langPrefix = lang.ToString();
var url = UrlResolver.Current.GetUrl(currentPage.ContentLink, langPrefix);
var absoluteUrl = Flurl.Url.Combine(currentSitePath.ToString(), url);
}
My variable
langURL
currently returns a non-friendly URL like so: http://localhost:57299/link/457fee1669e348febf67ecb57b281945.aspx?epslanguage=de-ATIs it possible to get a friendly URL?
For each page I would like to get the friendly urls with the language flag as well, for example: