Reputation: 249
My code:
<a data-toggle="dropdown">Associate Sites<i class="fa fa-angle-down"></i></a>
I tried following code:
namespaces:
@using System.Web.Mvc
@using Sitecore.Mvc
@using Glass.Mapper.Sc
@using Sitecore.Mvc.Presentation
@inherits Glass.Mapper.Sc.Web.Mvc.GlassView<CassiaMvc.Models.Footer>
Code:
@Html.Sitecore().BeginField("Link Field", new { @data-toggle="dropdown" })
@Html.Sitecore().Field("Destination URL", item)
@Html.Sitecore().EndField()
Please let me know what am doing wrong.
Upvotes: 0
Views: 2203
Reputation: 4266
You can't use hyphens for property names in a dynamic object. Change the hyphens to underscores:
@Html.Sitecore().BeginField("Link Field", new { @data-toggle="dropdown" })
to
@Html.Sitecore().BeginField("Link Field", new { @data_toggle="dropdown" })
The field renderer should convert the underscores to hyphens when rendered.
Upvotes: 3