RenderLink in page editor HTML encodes parameters

69 views
Skip to first unread message

Ettienne Gous

unread,
Oct 16, 2014, 12:47:48 AM10/16/14
to glass...@googlegroups.com
Currently I have a link definition that looks like this

@(new HtmlString(GlassHtml.RenderLink(Model, x => x.Link_URL, new Glass.Mapper.Sc.RenderField.LinkParameters { Class = Model.Link_Class + " btn-uppercase" }, true, contents: Model.Link_Label)))

It works as expected on normal page view

Working
<a parameters="System.Collections.Specialized.NameValueCollection" text="" class="btn btn-k1 btn-uppercase" title="" target="" href="/Regions/Africa-and-Middle-East">Explore Tour</a>

However when it goes over to page editor I get the following

Broken
<a class="btn+btn-k1+btn-uppercase scEnabledChrome" parameters="System.Collections.Specialized.NameValueCollection" href="/Regions/Africa-and-Middle-East" sc-part-of="field">Explore Tour</a>

The class attribute is encoded with + that replace the spaces and breaks the button styling.
I have tried the following

  • Remove the wrapping @HtmlString
  • Tried replacing the current implementation with a BeginRenderLink block to see if it makes any difference

Both of these didnt seem to help.
Any other suggestions would be greatly appreciated.





Reply all
Reply to author
Forward
0 new messages