Hi,
If I had an extra field extended for CalendarEvents, like a category field. Could I filter that with UpcomingEvents()? If so, how should I go about it?
John
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.
I believe the second argument for Calendar::UpcomingEvents() is a filter clause.
I thought it was the url?
That's for the function that's decorated on the SiteTree. That's just a convenient wrapper for Calendar::UpcomingEvents().
You'll have to write a custom function in your controller.. something like:
if($calendar = DataObject::get_one("Calendar", ... filter clause if necessary))
return $calendar->UpcomingEvents(5, "Category = Foo");
return false;
Excellent.
Got another question to pick your brain with.
On the list of upcoming events I have this:
Royal Rangers meeting (reoccurring)
Royal Rangers meeting (reoccurring)
Royal Rangers meeting (reoccurring)
Royal Rangers Assembly (onetime)
Some other one time event (onetime)
What would I do to to filter like this.
Royal Rangers meeting (most recent reoccurring of this series)
Royal Rangers Assembly (onetime)
Some other one time event (onetime)
Any idea?