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 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

Adding an Image to the Event Calendar

Go to End

26 Posts   8789 Views


Forum Moderator, 4102 Posts

2 July 2009 at 4:41am

Well that's not the point. I'm just saying it's not just the values that are missing from your template. It's not even rendering the structure that you say you're using. If you view the source of your page, there is no <dl> tag that is supposed to be containing those values, so you might want to double check your template. Something isn't in the right place.


Community Member, 34 Posts

3 July 2009 at 2:11am

I'm sorry UncleCheese, This is all my fault, I gave you the wrong URL. :( pls forgive me, here we go:

So back to my previous question:


Community Member, 11 Posts

24 October 2009 at 6:38am

Edited: 24/10/2009 7:59am

Hello OutrunTheWolf,

I had a similar problem and fixed it using the following:

Updated Solution:

In your Template "" Use this convention: $Event.ItemName
In your Template "" Use this convention: $ItemName

@UncleCheese, Is there a particular reason I am having to use these two different methods to display the variables in each template? There does not appear to be any difference between my two templates and I give control to Event before referencing any of the Custom Data.


Community Member, 63 Posts

29 May 2011 at 5:45am

sorry for warming up this years old threat but...

... I also had the wish to include a "teaser" pic to my events. I´ve read the Workshop tutorial but couldn´t get it to work (probably because I suck at .php). So I tried to modify the CalendarEvent.php (even though it´s recommended not to, but I have loads of events and all of them should get a pic ... I don´t wanna re-do all events in a workshop calendar again) and got it running so far... meaning it let´s me upload images but I don´t get them to show on my event pages :-(
I´ve already tried to insert images via CMS content field but this is horrible. No matter how I align the images they always stick to the left and act as block elements dividing my text!!! I would choose that over the event.image method but somehow it doesn´t seem to work (or is it just me?)
any help would be much appreciated!!!


Community Member, 63 Posts

29 May 2011 at 6:10am

btw I just found this .vevent #eventImage img { float:right; } in the calendar.css ... so does this mean it´s supposed to contain images?


Forum Moderator, 4102 Posts

31 May 2011 at 3:34pm

You can decorate on to the event class to add an image field.


CalendarEventDecorator extends DataObjectDecorator {

public function extraStatics() {
return array (
'has_one' => array ('Image' => 'Image')


public function updateCMSFields(&$fields) {
$fields->addFieldToTab("Root.Content.Image", new ImageField('Image'));

Apply the decorator in your _config:


Do a /dev/build

Then on your template:



<% control Event %>$Image.SetWidth(200)<% end_control %>

Silverstripe tips, tutorials, screencasts, and more.


Community Member, 63 Posts

1 June 2011 at 1:11am

Thanks Uncle Cheese!

Did exactly what you said...only that $Event.Image didn´t work for me. I changed that to $Image and there was my image :-)

thanks again for the code!!
kind regards


Community Member, 110 Posts

1 February 2015 at 6:01am

I'm not sure how old this post is, and whether the solution still works with current versions of SilverStripe.

I've followed the instructions provided, but when I dev/build, I get the following error:

Fatal error: Class 'DataObjectDecorator' not found in /mysite/code/extensions/CalendarEventDecorator.php on line 3

I confess to not being very familiar with SS3 (most of my projects are still in SS2.4). Any pointers on where I'm going wrong would be very much appreciated.