diff --git a/Sdl.Web.Mvc/Controllers/PageController.cs b/Sdl.Web.Mvc/Controllers/PageController.cs index 13bc097f..3cd357e1 100644 --- a/Sdl.Web.Mvc/Controllers/PageController.cs +++ b/Sdl.Web.Mvc/Controllers/PageController.cs @@ -57,10 +57,12 @@ public virtual ActionResult Page(string pageUrl) /// null - response is redirected if the URL can be resolved public virtual ActionResult Resolve(string itemId, int localizationId, string defaultItemId = null, string defaultPath = null) { - string url = SiteConfiguration.LinkResolver.ResolveLink(string.Format("tcm:{0}-{1}-64", localizationId, itemId)); + var localization = SiteConfiguration.LocalizationResolver.GetLocalization(localizationId.ToString()); + + string url = SiteConfiguration.LinkResolver.ResolveLink(string.Format("tcm:{0}-{1}-64", localizationId, itemId), localization: localization); if (url == null && defaultItemId != null) { - url = SiteConfiguration.LinkResolver.ResolveLink(string.Format("tcm:{0}-{1}", localizationId, defaultItemId)); + url = SiteConfiguration.LinkResolver.ResolveLink(string.Format("tcm:{0}-{1}", localizationId, defaultItemId), localization: localization); } if (url == null) { diff --git a/Sdl.Web.Tridion/Mapping/DefaultModelBuilder.cs b/Sdl.Web.Tridion/Mapping/DefaultModelBuilder.cs index 59d1f643..a00828a1 100644 --- a/Sdl.Web.Tridion/Mapping/DefaultModelBuilder.cs +++ b/Sdl.Web.Tridion/Mapping/DefaultModelBuilder.cs @@ -221,7 +221,7 @@ public virtual void BuildEntityModel(ref EntityModel entityModel, IComponent com Link link = (Link)entityModel; if (String.IsNullOrEmpty(link.Url)) { - link.Url = SiteConfiguration.LinkResolver.ResolveLink(component.Id); + link.Url = SiteConfiguration.LinkResolver.ResolveLink(component.Id, localization: localization); } } @@ -726,7 +726,7 @@ protected virtual object MapComponent(IComponent component, Type modelType, Loca { if (modelType == typeof(string)) { - return SiteConfiguration.LinkResolver.ResolveLink(component.Id); + return SiteConfiguration.LinkResolver.ResolveLink(component.Id, localization: localization); } if (!modelType.IsSubclassOf(typeof(EntityModel))) @@ -909,6 +909,7 @@ protected virtual string ProcessPageMetadata(IPage page, IDictionary meta) { + if (field.FieldType==FieldType.Embedded) { if (field.EmbeddedValues!=null && field.EmbeddedValues.Count>0) diff --git a/Sdl.Web.Tridion/Mapping/DefaultProvider.cs b/Sdl.Web.Tridion/Mapping/DefaultProvider.cs index ea443e54..193489e7 100644 --- a/Sdl.Web.Tridion/Mapping/DefaultProvider.cs +++ b/Sdl.Web.Tridion/Mapping/DefaultProvider.cs @@ -182,7 +182,7 @@ public virtual void PopulateDynamicList(ContentList contentList, Localizat ILinkResolver linkResolver = SiteConfiguration.LinkResolver; foreach (Teaser item in queryResults) { - item.Link.Url = linkResolver.ResolveLink(item.Link.Url); + item.Link.Url = linkResolver.ResolveLink(item.Link.Url, localization: localization); } contentList.ItemListElements = queryResults.Cast().ToList(); diff --git a/Sdl.Web.Tridion/Mapping/DefaultRichTextProcessor.cs b/Sdl.Web.Tridion/Mapping/DefaultRichTextProcessor.cs index feec8a8f..79dafbfb 100644 --- a/Sdl.Web.Tridion/Mapping/DefaultRichTextProcessor.cs +++ b/Sdl.Web.Tridion/Mapping/DefaultRichTextProcessor.cs @@ -75,7 +75,7 @@ private RichText ResolveRichText(XmlDocument doc, Localization localization) if (!string.IsNullOrEmpty(tcmUri)) { // Try to resolve directly to Binary content of MM Component. - linkUrl = linkResolver.ResolveLink(tcmUri, resolveToBinary: true); + linkUrl = linkResolver.ResolveLink(tcmUri, true, localization); } } if (!string.IsNullOrEmpty(linkUrl))