Kentico 10 PageType的宏列表

时间:2017-11-07 15:19:08

标签: asp.net macros content-management-system kentico

我正在寻找一种解决方案来显示与定义的pagetype相对应的页面列表。我在ASCX中有以下解决方案,但我正在寻找Kentico 10的宏的对应关系。

此宏将用于类型页面中的多选字段。

DocumentHelper.GetDocuments("MyPageType").OnCurrentSite().OrderByAscending("MyField");

1 个答案:

答案 0 :(得分:2)

您可以像这样使用宏:

Documents["/%"].Children.WithAllData.Where("ClassName == 'MyPageType'").OrderBy("MyField").ApplyTransformation ("Your.Custom.RowTransformation", "<div class='content-before'>", "</div>");

关键是使用Documents对象

你也可以试试这个电话:

Documents.WithAllData.Where("NodeAliasPath LIKE '/%' AND ClassName = 'cms.menuitem'").OrderBy("DocumentName").ApplyTransformation ("Your.Custom.RowTransformation", "<div class='content-before'>", "</div>");