利用核心组件列表组件,可以轻松地创建动态和静态列表。
列表组件可用于创建子页面的动态列表或者任意定义项的静态列表。
可用的列表类型以及格式化选项可以由模板作者在“设计”对话框中定义。内容编辑者可在“编辑”对话框中从可用列表类型以及如何格式化列表元素中选择。
本文档介绍了列表组件 (v1),它最初随带 AEM 6.3 的核心组件 1.0.0 版引入。
下表列出了列表组件 (v1) 的兼容性。
AEM 版本 | 列表组件 v1 |
---|---|
6.3 | 兼容 |
6.4 | 兼容 |
本文档介绍了列表组件 (v1)。
有关当前版本的列表组件的详细信息,请参阅列表组件文档。
以下是摘自 We.Retail 的示例。
<div class="cmp cmp-list aem-GridColumn aem-GridColumn--default--12">
<ul>
<li>
<article>
<a href="/content/we-retail/us/en/experience/arctic-surfing-in-lofoten.html">
<span class="cmp-list--item-title">Arctic Surfing In Lofoten</span>
</a>
</article>
</li>
<li>
<article>
<a href="/content/we-retail/us/en/experience/summit-success-in-the-himalayas.html">
<span class="cmp-list--item-title">Summit Success in the Himalayas</span>
</a>
</article>
</li>
<li>
<article>
<a href="/content/we-retail/us/en/experience/climbing-on-kalymnos-island--greece.html">
<span class="cmp-list--item-title">Climbing on Kalymnos Island, Greece</span>
</a>
</article>
</li>
<li>
<article>
<a href="/content/we-retail/us/en/experience/running-at-the-great-wall-marathon.html">
<span class="cmp-list--item-title">Running at the Great Wall Marathon</span>
</a>
</article>
</li>
<li>
<article>
<a href="/content/we-retail/us/en/experience/skiing-deep-powder-in-siberia.html">
<span class="cmp-list--item-title">Skiing deep powder in Siberia</span>
</a>
</article>
</li>
<li>
<article>
<a href="/content/we-retail/us/en/experience/climbing-in-the-massif-du-mont-blanc.html">
<span class="cmp-list--item-title">Climbing in the Massif du Mont Blanc</span>
</a>
</article>
</li>
</ul>
</div>
"articles_list": {
"columnClassNames": "aem-GridColumn aem-GridColumn--default--12",
":type": "weretail/components/content/articleslist",
"tagsMatch": "any",
"displayAs": "teaser",
"feedEnabled": "true",
"listFrom": "children",
"limit": "0",
"orderBy": "cq:lastModified",
"pageMax": "0"
}
从核心组件执行 JSON 导出需要版本 1.1.0 的核心组件。有关更多信息,请参阅核心组件 v1 的兼容性信息。
利用“编辑”对话框,内容作者可以配置列表和列表元素。
列表可以通过不同方式构建。
无论构建列表的方式如何,始终可以配置排序选项。
根据内容作者选择如何构建列表,可以更改其他配置选项。
列表可以由当前页面的子页面或其他页面构建。
列表可使用固定项列表构建。
点击或单击添加按钮可在列表中插入新项。
列表可使用对 AEM 内容搜索的结果来构建。
列表可以使用在特定位置下与特定标记匹配的页面构建。
不论您选择如何构建列表,始终可以定义特定的排序选项。
使用项设置选项卡,可以配置列表元素的格式化。
模板作者可以使用“设计”对话框定义允许内容作者使用什么类型的列表以及可用的项设置。
在列表设置选项卡上,可以定义日期格式以及在组件中什么类型的列表可供内容作者使用。
在项设置选项卡上,可以定义在组件中可供内容作者使用的单独列表元素的格式化选项。
在 GitHub 上可找到有关列表组件的最新技术文档。
从 GitHub 可下载整个核心组件项目。
在核心组件开发人员文档中可找到有关开发核心组件的其他详细信息。