Environment: Sitecore 9.0.2 + Glass mapper
I have a model class like this:
public class SingleStack
{
public Glass.Mapper.Sc.Fields.Image Logo { get; set; }
public string Attraction_Name { get; set; }
public string Destination_Name { get; set; }
public bool Is_Atttraction { get; set; }
[SitecoreId]
public Guid ID { get; set; }
public Glass.Mapper.Sc.Fields.Link Explore_More_Link { get; set; }
}
From a list of object of class SingleStack, I am displaying the fields. On my website, everything is fine.
The situation changes in the Experience Editor.
The fields Attraction_Name
and Destination_Name
are not getting rendered. Logo
and Explore_More_Link
are getting rendered and editable.
Few points to note: 1. All the fields are coming from the same item in Sitecore.
- The
ID
field contains the GUID of the item being rendered.
Code to render in cshtml:
@if (!string.IsNullOrEmpty(stack.Destination_Name))
{
@Html.Glass().Editable(stack, x => x.Destination_Name)
}
There are no errors in console and log.