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 and Search Results

Go to End

10 Posts   1548 Views


15 April 2010 at 12:00pm Community Member, 29 Posts

When events on my event calendar appear in my search results, the $Link that the search results get is the $baseURL + $URLSegment, it doesn't include any of the date range parameters for the $Link, which makes the page all funky when it doesn't have date parameters.

Is this just a common problem or is there a fix?

Using SilverStripe 2.3.6


15 April 2010 at 12:48pm 4085 Posts

That doesn't seem right. It should default to the most nearest date if none is passed to it. When was the last time you updated EventCalendar?


15 April 2010 at 1:30pm Community Member, 29 Posts

March 4th, 2010

Updated using SVN Checkout.



15 April 2010 at 1:48pm 4085 Posts

What do you mean by "all funky?"


15 April 2010 at 1:53pm (Last edited: 15 April 2010 1:54pm), Community Member, 29 Posts

Well i'll just give you the example...

Search "plant" and hit enter.

Click the first result.

To view that same exact page not all funky...go to Education -> Lecture Series from the nav and choose the 3rd event.


15 April 2010 at 2:22pm (Last edited: 15 April 2010 2:24pm), Community Member, 29 Posts

Also while I've got you UncleCheese, how would I create a function as a control for pulling the top 2 results of for Upcoming Events? I know how to do that in a SQL Query but i'm unfamiliar with SilverStripe as a whole so far.

function UpcomingEvents() {
   $articles = DataObject::get("Page", "`ClassName` IN ('CalendarEvent')");
   $articles->sort("Date", "DESC");
   $returnarticles = $articles->getRange(0, 2);
   return $returnarticles;

Something like that? But I don't see that pulling specific dates.


15 April 2010 at 4:53pm 4085 Posts

UpcomingEvents($count = 5, $url_segment = null) is decorated into your SiteTree class, so you can use it anywhere. Same for RecentEvents().


16 April 2010 at 1:12am (Last edited: 16 April 2010 1:49am), Community Member, 29 Posts

No idea on why the search results are doing that? Should I update the core+modules or?

Seems also the control for <% control UpcomingEvents %> is also bringing in a broken $Link the same as search results and it doesn't seem to be ordering them according to date, and bringing in past events.

Go to Top