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.

All other Modules

Discuss all other Modules here.

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

Event Calendar Modul - Show Events of the whole year


Reply

7 Posts   1175 Views

Avatar
martin_w

25 January 2011 at 1:36am Community Member, 28 Posts

Hi everybody,

I have installed the event calendar modul (http://silverstripe.org/event-calendar/)

I would like to show all events of the year on the main event page. (even if its march.. there still should be the january and february).

Can anybody help me to get that work?

thanks, martin.

Avatar
UncleCheese

25 January 2011 at 3:30am 4085 Posts

/your-calendar/view/2011

Avatar
martin_w

25 January 2011 at 10:06pm Community Member, 28 Posts

hey hello,

thanks for the answer.
Of course that works.
But I want it to work when I am at "/your-calendar/"
so at the main page of the calendar.
is that possible too?

Avatar
lerni

25 January 2011 at 10:47pm Community Member, 80 Posts

could it be this one? in code/Calendar.php

static $defaultFutureMonths = 1;

Avatar
martin_w

25 January 2011 at 11:14pm Community Member, 28 Posts

well.. I cant get the whole year with changing the defaultFutureMonths.
it means just the future months.

Avatar
UncleCheese

26 January 2011 at 3:56am 4085 Posts

You could just set up a redirect for /your-calendar/ to /your-calendar/view/2011. You just have to remember to change it ever year.

Another solution would be to decorate Calendar_Controller and add an index() action.

public function index() {
return Director::redirect(Controller::join_links($this->Link(),'view',date('Y'));
}

--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

Avatar
martin_w

27 January 2011 at 4:14am Community Member, 28 Posts

thats a quite good idea, thanks a lot :)