From a38f4e6df58021d150942d07832571099e51f173 Mon Sep 17 00:00:00 2001 From: Roy Hyde Date: Wed, 27 Mar 2019 16:05:11 +1100 Subject: [PATCH] Adding an option for forcing the alternate tag in the BeginLinks in the XE, as there are issues with displaying components with these taks in 9.1 in the XE when the component only has a section tag surrounding it. --- src/DeloitteDigital.Atlas/Mvc/HtmlExtensions.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/DeloitteDigital.Atlas/Mvc/HtmlExtensions.cs b/src/DeloitteDigital.Atlas/Mvc/HtmlExtensions.cs index 71b1cc4..b82a146 100644 --- a/src/DeloitteDigital.Atlas/Mvc/HtmlExtensions.cs +++ b/src/DeloitteDigital.Atlas/Mvc/HtmlExtensions.cs @@ -18,10 +18,12 @@ public static MvcEditFrame BeginEditFrame(this HtmlHelper helper, string d return frame; } - public static IDisposable BeginLink(this HtmlHelper htmlHelper, ILinkFieldRenderingString linkField, string alternateTag = null, bool skipInPageEditor = false, string linkTagClass = null) + public static IDisposable BeginLink(this HtmlHelper htmlHelper, ILinkFieldRenderingString linkField, string alternateTag = null, bool skipInPageEditor = false, bool alternateTagInPageEditor = false, string linkTagClass = null) { if (skipInPageEditor && global::Sitecore.Context.PageMode.IsExperienceEditor) return new EmptyMvcLink(); + if (alternateTagInPageEditor && global::Sitecore.Context.PageMode.IsExperienceEditor) + return new MvcLink(htmlHelper.ViewContext, null, alternateTag, linkTagClass); return new MvcLink(htmlHelper.ViewContext, linkField, alternateTag, linkTagClass); } }