3

I've got an issue with edit frames on a multi-lingual site. I've got a view which renders an item, plus the children of the item. The parent item and each of the child items have Edit Frames for controlling the content. The code essentially looks like:

<div class="component">
    @using (BeginEditFrame(ItemIds.ParentEditFrame, Model.Id.ToString()))
    {
        <p class="cms-helper">Click here to edit parent component</p>
    }
    <div class="parent-content">@Editable(Model, m => m.RichTextData)</div>
    @foreach (var subContent in Model.SubContent.Where(sc => sc != null))
    {
        using (BeginEditFrame(ItemIds.SubContentEditFrame, subContent.Id.ToString()))
        {
            <p class="cms-helper">Click here to edit sub-content</p>
        }
        <div class="parent-content">@Editable(subContent, m => m.RichTextData)</div>
    }
</div>

This works well when I'm using the default language variant for the site, however when I switch to another language, the second edit frame (for the sub-items) doesn't always work:

  • If the child item exists in the secondary language only, then any updates made through the edit frame are lost on save.
  • If the item exists in the default site language and the secondary language, then it works as expected (changes are saved to the secondary language version).
  • It always works for the default language.

Has anyone seen this behaviour before?

Thanks, Mark

1 Answer 1

2

We've been able to resolve the issue.

It turns out that one of the base templates of the sub items' template had the Enforce Version Presence checkbox ticked in its Standard Values item. Unchecking this (at the item level or at the __Standard Values level) allowed the edit frame to work.

Even though this has resolved the immediate issue, I've raised this with Sitecore. I'm not sure that edit frames not working in that way is part of the expected behaviour if "Ensure Version Presence" is ticked. I'll update here if they acknowledge it as an issue and release a patch or similar.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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