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