我创建了CategoryPart,并为其添加了两个文本字段。我想在两个文本字段数据之间的页面中添加一些自定义数据。问题是当我想在Placement.info中指定文本字段的位置时,我只有一个Shap“Fields_Common_Text”用于页面中的所有文本字段,因此我不能为具有相同类型的不同字段指定不同的位置。 Orchard有没有办法做到这一点?提前谢谢。
我的Placement.info是这样的:
<Placement>
<Match DisplayType ="Detail">
<Place Parts_Category="Content:9"></Place>
<Place Fields_Common_Text="Content:10"></Place>
</Match>
</Placement>
驱动程序中的显示方法:
protected override DriverResult Display(CategoryPart part, string displayType, dynamic shapeHelper)
{
return ContentShape("Parts_Category", () => shapeHelper.Parts_Category(CategoryPart: part));
}
答案 0 :(得分:1)
是的。您可以为具有形状类型和字段名称的项目指定放置位置。例如,如果您的文本字段名为CategoryName
和CategoryType
,则可以定义以下展示位置:
<Placement>
<Match DisplayType ="Detail">
<Place Fields_Common_Text-CategoryName="Content:9"></Place>
<Place Fields_Common_Text-CategoryType="Content:10"></Place>
</Match>