我正在寻找一种解决方案来显示与定义的pagetype相对应的页面列表。我在ASCX中有以下解决方案,但我正在寻找Kentico 10的宏的对应关系。
此宏将用于类型页面中的多选字段。
DocumentHelper.GetDocuments("MyPageType").OnCurrentSite().OrderByAscending("MyField");
答案 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>");