How to sort contents based on published month and year
Hi All,
I am having several posts in my blog and I want to add Archive on my side bar which will be categorizing the posts based on month and year.
I am able to fetch all the unique months with year on my sidebar but I am not able to figure out how to display my posts by sorting and grouping only selected month and year.
Example:
I am having the following in my sidebar right now.
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
Whenever user clicks on November 2014 I want to display all the posts which was posted on November 2014 irrespective of date and time.
I am using macro to achieve this.
Sidebar macro is something like this
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@{
var blogs = Umbraco.TypedContentAtRoot().DescendantsOrSelf("ArticulateRichText").OrderBy("publishedDate desc");
How to sort contents based on published month and year
Hi All,
I am having several posts in my blog and I want to add Archive on my side bar which will be categorizing the posts based on month and year.
I am able to fetch all the unique months with year on my sidebar but I am not able to figure out how to display my posts by sorting and grouping only selected month and year.
Example:
I am having the following in my sidebar right now.
http://our.umbraco.org/forum/developers/razor/47243-Using-GroupBy-to-sort-a-list-by-year-and-month
is working on a reply...