It seems to indeed be possible to edit fields in a linked Component using XPM, but it requires the XpmMetadata
to be set on the Component before rendering it. For example:
myComponentPresentation.MyLinkedComponent.XpmMetadata = new Dictionary<string, object>
{
{ "ComponentID", "tcm:29-4268" },
{ "ComponentModified", "2017-10-24T08:57:35" },
{ "ComponentTemplateID", myComponentPresentation.XpmMetadata["ComponentTemplateID"] },
{ "ComponentTemplateModified", myComponentPresentation.XpmMetadata["ComponentTemplateModified"] },
{ "IsRepositoryPublished", false }
};
Now, this works if the correct ComponentID
for MyLinkedComponent
is supplied. For the ComponentTemplateID
, it seems to be alright to pass the parent's.
The XpmMetadata
is not set for linked Components in the DefaultModelBuilder
. Why this is, I do not know. But it seems like it goes back to the response from the Model Service.