【发布时间】:2011-11-28 17:48:48
【问题描述】:
我有两个不同页面类型的列表 - NewsItems 和 PressReleases。它们分别显示在一个列表中,并带有指向各个项目的链接。
现在我想将新闻稿项包含到新闻列表中,并使用新闻项的样式将它们显示为新闻项。它们共享新闻模板中使用的“标题”和“正文”等属性。
我想用两组页面提供 NewsItems 的 ListPage 不会那么困难,但我不明白如何控制项目页面的呈现。
我想从 NewsItem 或 PressReleaseItem 中获取 PageData 对象,并使用 News-Item.aspx 模板显示它,如果它在 NewsList 中被选中的话。但 EPiServer 将始终使用 PR-Item.aspx 呈现 PressReleaseItem,因为它在 PageType 设置中耦合。
有人知道怎么做吗?
编辑:努力澄清:
重要的问题是如何知道“列表父级”并从中选择正确的模板。 In the ListPage I can apply different looks on the PR and News items respectively using tompipes answer, but when selecting to see an individual item EPi will render the PR-Item-1 the same way regardless of their "list parent".这就是问题所在。
【问题讨论】:
标签: episerver