3

文档说(强调):

某些字段也有特殊的扩展,以便放置可以针对特定的字段实例。

某些字段是否包括 DateTime、Link 和 Input 字段?

我试图在 NewsItem 内容类型中隐藏一个名为 Date 的 DateTime 字段。这是我的placement.info。重要的是,这个placement.info 来自一个主题,而不是来自一个模块

<Match ContentType="NewsItem">

  <!--These ones do not work.-->
  <Place Fields_Input="-" />
  <Place Fields_DateTime="-" />
  <Place Fields_DateTime-Date="-" />
  <Place Fields_Link="-" />

  <!--These ones do work-->
  <Place Parts_Title="-" />
  <Place Parts_Common_Metadata="-" />
  <Place Fields_Common_Text="-" />
  <Place Parts_Common_Body="-" />
  <Place Parts_Common_Body_Summary="-" />
  <Place Fields_MediaLibraryPicker="-" />

</Match>

这是其中一个字段的形状跟踪模型:

Fields_DateTime 或 Fields_DateTime-Date 应该可以工作。

4

1 回答 1

2

我刚刚遇到了这个问题,所以我想将此评论提升为正确的答案,因为它似乎是关键:

... Orchard.FieldsPlacement.info中的优先级可能高于 [a custom] 模块中的优先级...在 [the custom module's]文件中添加一个 Dependencies 字段,以确保 [the custom] 模块优先于Orchard .Fields文件。Module.txtPlacement.info Placement.info

如果您尝试从模块中覆盖形状以在管理员内显示(例如在SummaryAdmin模式下),请确保Module.txt列出生成您尝试覆盖的形状的模块的依赖关系。

例如,如果你想覆盖Fields_MediaLibraryPicker_SummaryAdmin展示位置,你Module.txt至少应该有:

Depedencies: Orchard.MediaLibrary

感谢@Shaun Luttin 和@Piedone

于 2016-08-08T20:34:10.017 回答