Order of months in agenda block?

Permalink Browser Info Environment
Currently, the agenda view block shows the current month at the bottom of the list, or in the opposite chronological order than I would like…

how can I change that?

At the same time, is it possible to add the year to the Month headings? We have events stretching far into the future, and while I want them all to show, I'd like the nearest/most relevant to be at the top of the list and the furthest away at the end, with both month & year in the headings, so I'll have

> March 2012
> April 2012
> May 2012

etc., instead of

> May
> April
> March

as I do currently.

Thanks!!

Type: Discussion
Status: Archived
YDSsite
View Replies:
GregJoyce replied on at Permalink Reply
GregJoyce
yes, you need to modify the file view_agenda.php to switch the order. On line 54 there is a for loop, you can use the reverse() function on the list of events just before the loop starts like this :
jsObj.events.reverse();
for(var i=0;i<jsObj.events.length;i++){
   var n = this.getDateNode( jsObj.events[i].dateKey, jsObj.events[i].dateTitle );
   //prevent duplicates, ie8 doen't keep quotes in it's innerhtml
   //if(n.innerHTML.indexOf('"eventNode'+jsObj.events[i].id+'"')!=-1) continue;
   if(n.innerHTML.indexOf('eventNode'+jsObj.events[i].id)!=-1) continue;
   n.innerHTML=n.innerHTML+jsObj.events[i].html;
   //this.eventsListWrap.html( this.eventsListWrap.html() + jsObj.events[i].html );
}


The version I'm looking at has the whole date string, like 'day of the week, year, calendar date'. In the future you will want to use the suppport forums for questions like this because it includes some environment info so we can see what your configuration looks like a little bit. Not sure if it applies in this case or not.
YDSsite replied on at Permalink Reply
YDSsite
I found the php file and that loop, and added that line… but no effect. WIll send more specifics via Support. Sorry I didn't before… I'm new to C5.

Thank you very, very much for your help!!!
ConcreteCMS replied on at Permalink Reply
ConcreteCMS
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.

To re-open this issue, reply to this message.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.