在任意位置的一页中有两个相同类型的字段. [英] Have two field with the same type in one page with arbitrary place.

查看:39
本文介绍了在任意位置的一页中有两个相同类型的字段.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了 CategoryPart 并向其中添加了两个文本字段.我想在页面中的两个文本字段数据之间添加一些自定义数据.问题是当我想在 Placement.info 中指定文本字段的位置时,页面中的所有文本字段只有一个 ShapFields_Common_Text",因此我无法为具有相同类型的不同字段指定不同的位置.果园里有什么办法吗?提前致谢.

I created the CategoryPart and I added two text field to it. I want to add some custom data in the page between two text fields data. The problem is when I want to specify the place of the text field in Placement.info I just have one Shap "Fields_Common_Text" for all the text fields in the page so I can't specify different places for different fields with the same type. Is there any way to do it in Orchard? Thanks in advance.

我的 Placement.info 是这样的:

my Placement.info is like this:

   <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));
    }

推荐答案

是的.您可以使用形状类型和字段名称指定项目的位置.例如,如果您的文本字段名为 CategoryNameCategoryType,您可以定义以下位置:

Yes there is. You can specify placement for the items with the shape type and the name of the field. For example, if your text fields are named CategoryName and CategoryType, you can define following placement:

<Placement>
  <Match DisplayType ="Detail">
     <Place Fields_Common_Text-CategoryName="Content:9"></Place>
     <Place Fields_Common_Text-CategoryType="Content:10"></Place> 
  </Match>

这篇关于在任意位置的一页中有两个相同类型的字段.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆