Skip to content

Flows (OrchardCore.Flows)

流量(OrchardCore.Flows)

The Flows module provides methods to display content items directly within another content item. This is achieved with the Flow Part and the Bag Part.

Flows模块提供了直接在另一个内容项中显示内容项的方法。这是通过流动部件和袋部件实现的。

A good example of this would be a page with an FAQ section in it. A FAQ content type might have a question and an answer field, and the content editor can add new FAQs directly when editing the page.

一个很好的例子就是一个带有FAQ部分的页面。 FAQ内容类型可能有问题和答案字段,内容编辑器可以在编辑页面时直接添加新的常见问题解答。

Empty Flows and Bags

空流和袋

Flows and Bags that do not contain any content items will be displayed with a different shape name. For empty Flows, the shape name is FlowPart_Empty; for empty Bags, it's BagPart_Empty.

不包含任何内容项的流和包将以不同的形状名称显示。对于空的Flow,形状名称是FlowPart_Empty;对于空包,它是'BagPart_Empty`。

This allows you to conditionally show or hide empty Flows or Bags. For example, to hide a Flow part that has no items, you can add this to your placement file:

这允许您有条件地显示或隐藏空的流量或包。例如,要隐藏没有项目的Flow部分,可以将其添加到展示位置文件中:


  "FlowPart_Empty": [

   <font color=#0099ff size=4 face="黑体">“FlowPart_Empty”:[</font> 


    {

      "place": "-"

    }

  ]

   <font color=#0099ff size=4 face="黑体">]</font> 


And if you'd like to use the same template for Flow parts that have items and Flow parts that have no items, you could add this:

如果您想为包含物品的Flow零件和没有物品的Flow零件使用相同的模板,您可以添加以下内容:


  "FlowPart_Empty": [

   <font color=#0099ff size=4 face="黑体">“FlowPart_Empty”:[</font> 


    {

      "shape": "FlowPart" 

    }

  ]

   <font color=#0099ff size=4 face="黑体">]</font>