Hi I'm currently using Sitecore 8.1 update 1 with MVC5.2.3 and Glass Mapper. I'm having some issues with the Glass Mapper link field. I have created a template which is derived from Standard Rendering Parameters template in which I have used Sitecore General Link
field. Also I have created Model for that:
My model:
[SitecoreType(TemplateId = "{912B074D-F8BA-4AA7-9276-016515A1ACE8}")]
public class RelatedArticleParams
{
[SitecoreId]
public virtual Guid Id { get; set; }
public virtual string HeaderText { get; set; }
[SitecoreField(FieldType = SitecoreFieldType.GeneralLink)]
public Link Link { get; set; }
}
My View:
@{
var parameters = GetRenderingParameters<RelatedArticleParams>();
}
<a href="@parameters.Link.Url" class="linkdark">@parameters.Text</a>
Everything is fine if I add the link from presentation details at Sitecore backend. But when I click on this component at Sitecore Page Experience Editor and insert link to Rendering Parameters, then it will give An error occurred red line indication at top of the page. I cant insert link from Page Editor mode.
Please help me in this issue whether it is Glass Mapper bug or I am making any mistake ??
Thanks. Will appreciate your suggestions.
RelatedArticleParams
class has aHeaderText
property, but your view uses@parameters.Text
. Was this just a typo when creating the SO question or is that the real code? – Ben Golden