Jump to:

10990 Posts in 2727 Topics by 1818 members

All other Modules

SilverStripe Forums » All other Modules » Event Calendar - show only first of multi date event

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 541 Views
  • evanC
    Avatar
    Community Member
    1 Post

    Event Calendar - show only first of multi date event Link to this 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 %>
    </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!

    541 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.