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 - show only first of multi date event




17 January 2011 at 11:52am (Last edited: 17 January 2011 11:58am), Community Member, 1 Post

Hi, i have an image rotator, that shows images from the upcoming events. When i have a multiple date event, an image appears for each date, but i want it only to appear for the next event. What can i do?

<% control UpcomingEvents %>
<% if Event.Image %>
<li><a href="$Link">
<% control Event.Image %>
<img src="$URL" width="602" height="333" />
<% end_control %>
<% end_if %>
<% end_control %>

and in my code:

class HomePage_Controller extends Page_Controller {

function UpcomingEvents()
   return DataObject::get_one("Calendar")->upcomingEvents(50);


also, how can i set the image to a set size, $url.setwidth doesnt work obviously.