0

I want to group my content type to group by years in views, for example Archive 2014-2015 or Archive 2014-16. How can I get this groupings?

Archive 2013-2014
-COntent 1
-Content 2
-Content 3

Archive 2015-2016
-COntent 1
-Content 2
-Content 3

1 Answer 1

0

The key challenge you'll face here is that neither Views nor Date modules provide aggregation options for date-based fields.

This can be solved by using the Views Date Format SQL module. It adds a nice little check-box that allows you to group dates by a custom formatted string, as shown in this example also:

enter image description here

In the above example, the custom date format is set to "M Y" (which translates to Oct 2015 for example), and the box for "Use SQL to format Date" was checked. This is the only configuration needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.