Adding differentiator fallback for field locations override

Work Item: 16915

--HG--
branch : dev
This commit is contained in:
Renaud Paquay
2010-12-10 11:59:20 -08:00
parent 8e7adc6ee2
commit 9337e12134
7 changed files with 68 additions and 17 deletions

View File

@@ -16,12 +16,17 @@ namespace Orchard.Core.Common.Drivers {
return part.PartDefinition.Name + "." + field.Name;
}
private string GetDifferentiator(TextField field, ContentPart part) {
return field.Name;
}
protected override DriverResult Display(ContentPart part, TextField field, string displayType, dynamic shapeHelper) {
return ContentShape("Fields_Common_Text", () => shapeHelper.Fields_Common_Text(ContentField: field, Name: field.Name, Value: field.Value));
return ContentShape("Fields_Common_Text", GetDifferentiator(field, part),
() => shapeHelper.Fields_Common_Text(ContentField: field, Name: field.Name, Value: field.Value));
}
protected override DriverResult Editor(ContentPart part, TextField field, dynamic shapeHelper) {
return ContentShape("Fields_Common_Text_Edit",
return ContentShape("Fields_Common_Text_Edit", GetDifferentiator(field, part),
() => shapeHelper.EditorTemplate(TemplateName: "Fields.Common.Text.Edit", Model: field, Prefix: GetPrefix(field, part)));
}