10448 Posts in 2223 Topics by 1719 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 707 Views |
-
How to pull upcoming events but from one of two calendar

4 June 2010 at 9:49am
Hi all,
I have the event-calendar setup for regular calendar use. Then I created a module that is an extension of the event calendar that is for certain group meetings. This one is extended with event address, map, etc.On the homepage of the site, I would like to pull upcoming events, but only from the regular calendar. Not from the extended one.
When I use the following code in my page.php file, it pulls back events from the extended calendar.
public function UpcomingNonAnnouncements()
{
return DataObject::get_one("Calendar")->upcomingEvents(5);
}Any idea how I can fix this?
-
Re: How to pull upcoming events but from one of two calendar

4 June 2010 at 12:48pm
get_one("Calendar") is just going to select one arbitrarily. You need to add more criteria if you want to get a specific one.
Keep in mind, the UpcomingEvents() function that is decorated into all SiteTree objects takes a URLSegment as a second argument..
<% control UpcomingEvents(5,some-calendar) %>
-
Re: How to pull upcoming events but from one of two calendar

19 October 2011 at 3:59pm Last edited: 19 October 2011 5:35pm
Hi Uncle Cheese,
Is there a way I can test for if there are any upcoming events in a calendar? Essentially I have a sidebar block on my homepage showing my latest events, incluidng a headline of Latest Events. If there are no events I want the whole block to not be displayed.
| 707 Views | ||
|
Page:
1
|
Go to Top |

