【问题标题】:Kentico 10 Macro List of PageTypeKentico 10 PageType 的宏列表
【发布时间】:2017-11-07 15:19:07
【问题描述】:

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

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

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

【问题讨论】:

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


    【解决方案1】:

    你可以像这样使用宏:

    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>");
    

    【讨论】:

    • 这个宏在我的例子中返回 null。
    • 在宏控制台中测试和调整它。您可以在系统应用中找到它。
    • 检查更新的答案@DavidG。两者都适用于我的情况并返回一组页面。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-04
    • 1970-01-01
    • 1970-01-01
    • 2018-04-22
    • 2018-03-01
    • 1970-01-01
    相关资源
    最近更新 更多