Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

ArchiveWidget: Grouping by Months then Years


Go to End


1034 Views

Avatar
Strandoo

Community Member, 5 Posts

7 February 2017 at 1:29am

Edited: 07/02/2017 1:59am

Forgive me if this is obvious, but I couldn't find the answer if it's been posted before. I've created one site with SS and it was a few years ago, so I've forgotten a lot about it!

I've got a blog with a sidebar containing the ArchiveWidget. Currently it contains one long list of Months (December 2016, November 2016, ... January 2014). Is there a way to truncate the years for every year older than the current year?
Something like:
- December 2016
- November 2016
- ...
- January 2016
> 2015
> 2014

It would be best if the generated UL could be split into separate ULs for each year; that way I could use Jquery to collapse/display subsequent years (like an accordion). Thanks in advance.
Paul

EDIT: I realise I'm using an old version of the Blog Module. I'll look into upgrading and see if that solves my problem!