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.

All other Modules /

Discuss all other Modules here.

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

Calendar event module - upcoming events on homepage?


Go to End


36 Posts   9006 Views

Avatar
dreamstudio

Community Member, 48 Posts

19 March 2009 at 7:26am

Edited: 19/03/2009 7:31am

Im trying to add a similar thing... on every page have a upcoming events.. lets say the next 5 and put it into a side panel.... I looked at the code given above but it didnt work and wanted to know... do the pages have to be event page types or can it be put on any page and can you shed a little more light on where to add the code

Also ... is there a way to modify the look / size of the calender and then put that in the sidebar too

one other thing... when i click on the calendar for a date that has something.. it doesnt goto the correct url... it drops part of the url so instead of http://79.170.40.231/domainname.co.uk/events/2009-03-24 it goes to http://79.170.40.231/events/2009-03-24

if you actually click on an event it works ok just not on the calendar

is there a way to change the look of the calendar on the right side.. ie colours etc?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

19 March 2009 at 7:42am

Do you have the event_calendar module or the calendar module? Just making sure.. the code I sent you works for the event_calendar module.

To change the look and feel of the calendar widget, just edit your CSS file. It's all styled in an external stylesheet that is meant to be overridden.

To get the upcoming events on every page, just add this to your Page_Controller:

function UpcomingEvents()
{
return DataObject::get_one("Calendar")->upcomingEvents(5);
}

And you'll be able to do a <% control UpcomingEvents %> on any page.

The bug that was causing the calendar to redirect to the wrong URL was fixed a few versions ago. Make sure you do an SVN update.

Avatar
dreamstudio

Community Member, 48 Posts

19 March 2009 at 10:31am

Edited: 19/03/2009 10:36am

I tried getting the latest version that I can see at http://svn.codespaces.com/bluehousegroup/event_calendar but it asks for a username and password

the version I got was on your bluehouse group website... so not sure what version im running but cant get the latest due to passwording on the link

Also, forgive my ignorance... im picking up SS well but not sure when you say to put that code into the page controller.. do you mean the code

function UpcomingEvents()
{
return DataObject::get_one("Calendar")->upcomingEvents(5);
}

into page.ss under my theme or another location?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

19 March 2009 at 10:55am

That's really weird that the SVN is trying to authenticate you. I have anonymous checkout set up.

I posted a new SVN export to extensions.bluehousegroup.com. Try that.

Avatar
dreamstudio

Community Member, 48 Posts

19 March 2009 at 11:08am

I tried downloading that file but all the files inside the zip are 0.... so it cant export them

Avatar
dreamstudio

Community Member, 48 Posts

19 March 2009 at 9:57pm

I moved the files out of the zip by hand as a few files were 0 byte empty files.. which seems to have worked..

The only question is where do i copy the code you mentioned, which pages to load them to

Avatar
bummzack

Community Member, 904 Posts

19 March 2009 at 11:25pm

Edited: 19/03/2009 11:25pm

Hi UncleCheese

I just tried to download and install your calendar module and encountered the same SVN authentication problem as "dreamstudio" did.
Here's the command i used:

svn co http://svn.codespaces.com/bluehousegroup/event_calendar ~/Sites/SilverStripe-v2.3.1-rc2/event_calendar
Authentication realm: <http://svn.codespaces.com:80>; Code Spaces Subversion Repository Authentication
Password for 'roman': 

Any idea what could cause this?
Best - Roman

Avatar
dreamstudio

Community Member, 48 Posts

19 March 2009 at 11:48pm

After getting the zip file from your website working... installed and works ok, however couple of questions

On the documentation it says about blind down on the configuration menu... my install doesnt have that just the number of events, default date header and future dates.. so could it be the file i downloaded from your website is still an old version

Also you mentioned orignally about being able to put the upcoming events details on a homepage.... so is it possible to put the calendar widget on ANY page of a SS site... ie I want to put it down the side so people can go through the calendar and click a date.. as well as upcoming dates listed below that on the sidebar - is it possible or can you only drop calendar features on calendar pages

Lovely module by the way....