diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Extensions/UrlHelperExtensions.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Extensions/UrlHelperExtensions.cs index 8c03f05b1..8bf2e2503 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Extensions/UrlHelperExtensions.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Extensions/UrlHelperExtensions.cs @@ -31,15 +31,18 @@ namespace Orchard.Blogs.Extensions { } public static string BlogArchiveYear(this UrlHelper urlHelper, BlogPart blogPart, int year) { - return urlHelper.Action("ListByArchive", "BlogPost", new { path = VirtualPathUtility.Combine((blogPart.As().Path ?? string.Empty) + "/", "archive/") + year.ToString(), area = "Orchard.Blogs" }); + var blogPath = blogPart.As().Path; + return urlHelper.Action("ListByArchive", "BlogPost", new { path = (string.IsNullOrWhiteSpace(blogPath) ? "archive/" : blogPath + "/archive/") + year.ToString(), area = "Orchard.Blogs" }); } public static string BlogArchiveMonth(this UrlHelper urlHelper, BlogPart blogPart, int year, int month) { - return urlHelper.Action("ListByArchive", "BlogPost", new { path = VirtualPathUtility.Combine((blogPart.As().Path ?? string.Empty) + "/", "archive/") + string.Format("{0}/{1}", year, month), area = "Orchard.Blogs" }); + var blogPath = blogPart.As().Path; + return urlHelper.Action("ListByArchive", "BlogPost", new { path = (string.IsNullOrWhiteSpace(blogPath) ? "archive/" : blogPath + "/archive/") + string.Format("{0}/{1}", year, month), area = "Orchard.Blogs" }); } public static string BlogArchiveDay(this UrlHelper urlHelper, BlogPart blogPart, int year, int month, int day) { - return urlHelper.Action("ListByArchive", "BlogPost", new { path = VirtualPathUtility.Combine((blogPart.As().Path ?? string.Empty) + "/", "archive/") + string.Format("{0}/{1}/{2}", year, month, day), area = "Orchard.Blogs" }); + var blogPath = blogPart.As().Path; + return urlHelper.Action("ListByArchive", "BlogPost", new { path = (string.IsNullOrWhiteSpace(blogPath) ? "archive/" : blogPath + "/archive/") + string.Format("{0}/{1}/{2}", year, month, day), area = "Orchard.Blogs" }); } public static string BlogForAdmin(this UrlHelper urlHelper, BlogPart blogPart) { diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts.Blogs.BlogArchives.cshtml b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts.Blogs.BlogArchives.cshtml index 58b3575b6..22dce3c4a 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts.Blogs.BlogArchives.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Views/Parts.Blogs.BlogArchives.cshtml @@ -18,7 +18,8 @@ if (year == lastYear) {
  • @year

    -
  • + @Html.UnorderedList(yearMonths, (t, i) => Html.Link(string.Format("{0:MMMM} ({1})", t.Key.ToDateTime(), t.Value), Url.BlogArchiveMonth((BlogPart)Model.Blog, t.Key.Year, t.Key.Month)), "archiveMonthList") + } if (year != lastYear) {