Lists (OrchardCore.Lists)
列表(OrchardCore.Lists)
Theming
主题化
Shapes
形状
These shapes are available for theming when a ListPart
is attached to a content item.
当“ListPart”附加到内容项时,这些形状可用于主题。
| Name | Display Type | Default Location | Model Type |
|名称|显示类型|默认位置|型号类型|
| ------| ------------ |----------------- | ---------- |
| ------ | ------------ | ----------------- | ---------- |
| ListPart
| Detail
, DetailAdmin
| Content:10
| ListPartViewModel
|
| ListPart
| Detail
,DetailAdmin
| 内容:10
| ListPartViewModel
|
ListPartViewModel
ListPartViewModel
The following properties are available on the ListPartViewModel
class.
ListPartViewModel
类提供以下属性。
| Property | Type | Description |
|财产|输入|说明|
| --------- | ---- |------------ |
| --------- | ---- | ------------ |
| ListPart
| ListPart
| The ListPart
instance |
| ListPart
| ListPart
| ListPart
实例|
| ContentItems
| IEnumerable<ContentItem>
| The content items the part is made of |
| ContentItems
| IEnumerable <ContentItem>
|部件的内容项由|组成
| ContainedContentTypeDefinitions
| IEnumerable<ContentTypeDefinition>
| The content types the list accepts |
| ContainedContentTypeDefinitions
| IEnumerable <ContentTypeDefinition>
|列表接受的内容类型
| Context
| BuildPartDisplayContext
| The current display context |
| Context
| BuildPartDisplayContext
|当前显示上下文|
| Pager
| dynamic
| The pager for the list |
| 寻呼机
| dynamic
|列表的寻呼机|
ListPart
ListPart
The following properties are available on the ListPart
class.
ListPart
类提供以下属性。
| Name | Type | Description |
|名称|输入|说明|
| -----| ---- |------------ |
| ----- | ---- | ------------ |
| Content
| The raw content of the part |
| 内容
|部分的原始内容|
| ContentItem
| The content item containing this part |
| ContentItem
|包含此部分的内容项目
Template
模板
The following example is used to render the items of a ListPart
and customize the pager.
以下示例用于呈现ListPart
的项目并自定义寻呼机。
For instance it can be set in a file named Blog-ListPart.liquid
to override the Blog
content type only.
例如,它可以在名为Blog-ListPart.liquid
的文件中设置,以仅覆盖Blog
内容类型。
{% for item in Model.ContentItems %}
<font color=#0099ff size=4 face="黑体">{%for Model.ContentItems%}中的项目</font>
{{ item | shape_build_display: "Summary" | shape_render }}
{% endfor %}
<font color=#0099ff size=4 face="黑体">{%endfor%}</font>
<font color=#0099ff size=4 face="黑体"></font>
{% assign previousText = "Newer Posts" | t %}
<font color=#0099ff size=4 face="黑体">{%assign previousText =“较新的帖子”| t%}</font>
{% assign nextText = "Older Posts" | t %}
<font color=#0099ff size=4 face="黑体">{%assign nextText =“较旧的帖子”| t%}</font>
{% assign previousClass = "previous" | t %}
<font color=#0099ff size=4 face="黑体">{%assign previousClass =“previous”| t%}</font>
{% assign nextClass = "next" | t %}
<font color=#0099ff size=4 face="黑体">{%assign nextClass =“next”| t%}</font>
<font color=#0099ff size=4 face="黑体"></font>
{% shape_pager Model.Pager previous_text: previousText, next_text: nextText,
<font color=#0099ff size=4 face="黑体">{%shape_pager Model.Pager previous_text:previousText,next_text:nextText,</font>
previous_class: previousClass, next_class: nextClass %}
<font color=#0099ff size=4 face="黑体"></font>
{{ Model.Pager | shape_render }}
<font color=#0099ff size=4 face="黑体">{{Model.Pager | shape_render}}</font>