Sitecore Glassmapper Fields not editable

816 views Asked by At

Hi I am new to glassmapper and i am trying to create a simple view rendering. While the view works, i am not able to edit it in experience editor. Is there like a setting that i should turn on???

My View is as simple is this:

@inherits Glass.Mapper.Sc.Web.Mvc.GlassView<sample.Web.Models.sampleclass>
@if (Model != null)
{
    <div>
      @Editable(Model,x=>x.Title)
    </div>
}

My Modal:

using Glass.Mapper.Sc.Configuration.Attributes;
using System;

namespace Sampple.Web.Models.Sampleclass
{
    [SitecoreType(TemplateId = "{FE05DA0F-7E18-47F8-AB77-F0ED7A0F9F90}",AutoMap = true)]
    public class Sampleclass
    {

        [SitecoreId]
        public virtual Guid Id { get; set; }

        public virtual string Title{ get; set; }

    [SitecoreField("Page Content")]
        public virtual string Body{ get; set; }

    }
}

I am able to see the content. It just that it is not editable when i open

http://mysite/?sc_mode=edit

Sidenote: i have changed the class names for explanation. Please ignore any typos

1

There are 1 answers

3
Akhil On

I this fixed?

If not, try below options:

  • When you open Sitecore Item in Experience Editor and when clicked on any field you must see those fields highlighted as in below screen shots, Then try to edit it within that highlighted area

Screen Shot 1

Screen Shot 2

  • if you are at the right place and if it is till not working. Can you check Sitecore Logs if there are any errors recorded.

  • Looking at the code it looks like you missed to map "Title" field.