如何将子页面最后添加的三个数据加载到首页

How to load the last three added data from sub pages into home page

我有一个页面包含带有标题、图像和描述的卡片,我可以添加任意数量的卡片,然后我想在主页中加载这些数据,但我需要它只显示最后添加的 3 个该页面

假设您的卡片内容由 apostrophe-pieces 子类提供支持,您希望使用 apostrophe-pieces-widgets 动态提取最后 3 个部分并将它们添加到任何页面(在您的情况下是主页).

本教程详细介绍了起床和 运行 apostrophe-pieces-widgets https://docs.apostrophecms.org/apostrophe/tutorials/getting-started/reusable-content-with-pieces#displaying-pieces-with-widgets

在模板中添加小部件后,您希望将小部件配置为 Select from All.. 并将其限制为 3.

您可以通过访问 Apostrophe Open Museum demo 并使用主页上的以下小部件来演示此类小部件的编辑体验