Crafter CMS:从不同的 page/content-type 检索数据

Crafter CMS: retrieving data from a different page/content-type

是否可以从单独的页面检索数据?我只知道如何在我的 ftl 模板中使用 contentModel.VARIABLENAME

比如我现在在A​​页但是我要显示的数据来自B页.

您可以使用 siteItemService:

<#assign pageB = siteItemService.getSiteItem("/site/website/path/to/pageB/index.xml") />

您只需将 path/to/pageB 替换为边栏中显示的页面路径。返回的对象与 contentModel 的类型完全相同,因此您可以执行 siteItemService.VARIABLENAME