I am looking for some help in figuring out an appropriate approach to this setup.
I have a Sitecore tree that looks something like this:
- content
- settings
- home
- potato
- spud1
- spud2
- potato
The settings
node has a droplink field that points to the potato
item. I have a POCO model that roughly looks like this:
[SitecoreType( AutoMap=true, TemplateId="1234..." )]
public class ModelA {
public virtual Guid Id { get; set;}
public virtual String Name { get; set; }
public virtual ModelB Potato { get; set; }
}
[SitecoreType( AutoMap=true, TemplateId="1235..." )]
public class ModelB {
public virtual Guid Id { get; set;}
public virtual IEnumerable<Spud> Children { get; set; }
}
While the general rendering behaviour of this setup seems fine, we're having some issues trying to get an edit frame where we can add a new spud3
to the list of spuds.
The current setup has been centered around:
@using( BeginEditFrame( Model, "Title", m => m.Potato ) ) {}
but this isn't really doing what we want (haven't got exactly what it's not doing at hand as I'm posting on behalf of someone, but will update in 12hrs time with additional detail).
Assuming what we're trying to do is reasonable, can anyone spot the issue in the setup above?
We've also noticed a (probably known) bug where if the last 2 (supposedly optional) arguments of the BeginEditFrame()
method are omitted a NullReferenceException
is thrown from Sitecore's WebControl::GetItem()
.
[Note please @MikeEdwards if you're reading this ;)]