public override string GetItemUrl(Item item, UrlOptions urlOptions) { var holdUrlOptions = urlOptions; try { urlOptions = LanguageHelper.CheckOverrideLanguageEmbedding(urlOptions); urlOptions.SiteResolving = Settings.Rendering.SiteResolving; return(base.GetItemUrl(item, urlOptions)); } catch { urlOptions.SiteResolving = Settings.Rendering.SiteResolving; return(base.GetItemUrl(item, holdUrlOptions)); } }
public override string GetMediaUrl(MediaItem item, MediaUrlOptions options) { Assert.ArgumentNotNull((object)item, "item"); Assert.ArgumentNotNull((object)options, "options"); string result = base.GetMediaUrl(item, options); // Added by Verndale, check if language should be embedded UrlOptions urlOptions = UrlOptions.DefaultOptions; urlOptions = LanguageHelper.CheckOverrideLanguageEmbedding(urlOptions); if (urlOptions.LanguageEmbedding == LanguageEmbedding.Always && options.UseItemPath) { result = "/" + Sitecore.Context.Language.Name.ToLowerInvariant() + Sitecore.StringUtil.EnsurePrefix('/', result); } return(result); }