0

After upgrading to Sitecore 9.3 and GlassMapper 5+ the TemplateId and TemplateName are coming back as nulls. The item is retrieved using MvcCurrentContext.GetContextItem.

TemplateId: {00000000-0000-0000-0000-000000000000}
TemplateName: null

The item model is generated as follows. Are there new settings for 5?

[SitecoreType(TemplateId=TestPage_PageConstants.TemplateIdString )]
2
  • 1
    Is you property virtual? Sep 25 '20 at 17:06
  • Found when adding virtual to the template defintion it worked. Now I just need to change that so it generates correctly.
    – RReilley
    Sep 25 '20 at 19:53
3

Make sure your property is Virtual, we faced the same issue in Sitecore 9.3, after adding virtual it resolved for us. eg -

public virtual string Title { get; set; }
1
  • Found when adding virtual to the template defintion it worked. Now I just need to change that so it generates correctly.
    – RReilley
    Sep 25 '20 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.