By gisle on
Views comes with a disabled view named "Archive". It will display all content, by month.
I want something very similar, but by year, so I'll have a block like this:
Where the numbers in parenthesises are the number of archived post of the year. The year links to a list with all the posts for the year.
Is there a way to tweak the "Archive" view to give me this?
Or is there another way to create a yearly archive block?
Comments
In Drupal 11.2:
In Drupal 11.2:
Created yearwith "Display a summary" set.Created year + monthcontextual filter./archive/2025, and the/archive/path is handled by the original Archive view, which is expecting/archive/202506(year plus month)./archive-duplicate. This makes your page listen at that path./archive-duplicate/2025and that should work.Of course having URLs containing
/archive-duplicate/is undesirable. After going through this process you should have the knowledge needed to set it up the way you want, which may include customizing the stock Archive view to not squat on the /archive/ path so that you can use it. Or just use/archives/for your duplicate.I have not figured out how to get the months nested as nodes under each year, which is what I want.