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


Reply


592 Views

Avatar
evanC

Community Member, 1 Post

17 January 2011 at 11:52am

Edited: 17/01/2011 11:58am

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 %>
</a></li>
<% 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.

thanks!