【问题标题】:Using Orchard CMS how do I change the heading displayed in the list of content items使用 Orchard CMS 如何更改内容项列表中显示的标题
【发布时间】:2011-06-17 03:45:09
【问题描述】:

我在 Orchard CMS 中创建了一个新模块,我有一个包含大量自定义字段的新事件部分。如何更改内容列表中显示的标题?

谢谢

【问题讨论】:

    标签: orchardcms


    【解决方案1】:

    可以在Handler中设置元数据

    protected override void GetItemMetadata(GetContentItemMetadataContext context)
    {
        // We will set the display text, appears in content list
        var e = context.ContentItem.As<EventPart>();
        if (e != null)
        {
            context.Metadata.DisplayText = e.Name;
        }
    }
    

    【讨论】:

    • 谢谢你罗汉你的传奇
    【解决方案2】:

    您可以使用 ITitleAspect 方法:

    public interface ITitleAspect : IContent {
        string Title { get; }
    }
    

    David Hayden's fine post 所示。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多