1
votes

I have two Sitecore templates - a Base template and a Test template which inherits from the Base template. The Base template contains a field called title and the Test template contains a field called page description.

I have a Test Template view model inheriting from the Base template view model (which implements IRenderingModel).

The Base template view model has this property:

public HtmlString RenderedTitle
    {
        get
        {
            return new HtmlString(FieldRenderer.Render(Item, "Title"));
        }
    }

And the Test Template View Model has this property:

public HtmlString RenderedPageDescription
{
    get
    {
        return new HtmlString(FieldRenderer.Render(Item, "Page Description"));
    }
}

I also have my view outputting these two properties:

@Model.RenderedTitle
@Model.RenderedPageDescription

The Problem is that when I view the page in the page editor, only the renderedPageDescription property is editable. For whatever reason, the RenderedTitle property is not being set as editable. I tried throwing the RenderedTitle property into the Test Template View Model and it worked fine.

Does anyone have any ideas of why the RenderedTitle property is not editable when it's in the parent class?

Thanks in advance.

(I'm also using Sitecore 7.2)

1
From where is 'Item' property coming from? - Ahmed Okour

1 Answers

0
votes

Do you have the following line in the Initialize() method on your Test Template View Model?

base.Initialize(rendering);

i.e.

Public override void Initialize(Rendering rendering)
{
    base.Initialize(rendering)
}