mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
#5348: Splitting ItemDisplayText in two
This commit is contained in:
@@ -7,7 +7,12 @@ using Orchard.Utility.Extensions;
|
||||
|
||||
namespace Orchard.Mvc.Html {
|
||||
public static class ContentItemExtensions {
|
||||
public static MvcHtmlString ItemDisplayText(this HtmlHelper html, IContent content, bool encode = true) {
|
||||
|
||||
public static MvcHtmlString ItemDisplayText(this HtmlHelper html, IContent content) {
|
||||
return ItemDisplayText(content, true);
|
||||
}
|
||||
|
||||
public static MvcHtmlString ItemDisplayText(this HtmlHelper html, IContent content, bool encode) {
|
||||
var metadata = content.ContentItem.ContentManager.GetItemMetadata(content);
|
||||
if (metadata.DisplayText == null)
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user