Refactoring ContentItemExtensions

The usage of the optional parameter was not working
correctly on my setup.
This commit is contained in:
Sebastien Ros
2014-01-02 11:49:03 -08:00
parent c1c1a1ff2c
commit ec788d13eb

View File

@@ -14,10 +14,18 @@ namespace Orchard.Mvc.Html {
return MvcHtmlString.Create(html.Encode(metadata.DisplayText));
}
public static MvcHtmlString ItemDisplayLink(this HtmlHelper html, IContent content, object htmlAttributes = null) {
public static MvcHtmlString ItemDisplayLink(this HtmlHelper html, IContent content) {
return ItemDisplayLink(html, null, content, null);
}
public static MvcHtmlString ItemDisplayLink(this HtmlHelper html, IContent content, object htmlAttributes) {
return ItemDisplayLink(html, null, content, htmlAttributes);
}
public static MvcHtmlString ItemDisplayLink(this HtmlHelper html, string linkText, IContent content) {
return ItemDisplayLink(html, linkText, content, null);
}
public static MvcHtmlString ItemDisplayLink(this HtmlHelper html, string linkText, IContent content, object htmlAttributes = null) {
var metadata = content.ContentItem.ContentManager.GetItemMetadata(content);
if (metadata.DisplayRouteValues == null)