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

Event Calendar - show only first of multi date event


Go to End


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