To support bindings and time periods, it is better to use link.BuildUrl((SafeDictionary<string>)null)
There are two methods Link.BuildUrl() , and, paradoxically, both parameters have default parameters (although one of them is marked as deprecated). You will need to indicate which one is entered using the null character or ...
You can add an extension method that makes it easier
public static class GlassFieldExtensions { public static string GetUrl(this Link link) { return link.BuildUrl(null as SafeDictionary<string>); } }
And in HTML:
@foreach (var socialLink in Model.SocialFolder.Socials) { <a href="@socialLink.GetUrl()" class="connect @socialLink.Class">@socialLink.Description</a> }
source share