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
Reply


10 Posts   1677 Views

Avatar
churika

Community Member, 29 Posts

15 April 2010 at 12:00pm

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

Avatar
UncleCheese

Forum Moderator, 4096 Posts

15 April 2010 at 12:48pm

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?

Avatar
churika

Community Member, 29 Posts

15 April 2010 at 1:30pm

March 4th, 2010

Updated using SVN Checkout.

SVN URL = http://carlinowebdesign.svn.beanstalkapp.com/modules/trunk/

Avatar
UncleCheese

Forum Moderator, 4096 Posts

15 April 2010 at 1:48pm

What do you mean by "all funky?"

Avatar
churika

Community Member, 29 Posts

15 April 2010 at 1:53pm

Edited: 15/04/2010 1:54pm

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

http://new.pjcbg.org

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.

Avatar
churika

Community Member, 29 Posts

15 April 2010 at 2:22pm

Edited: 15/04/2010 2:24pm

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.

Avatar
UncleCheese

Forum Moderator, 4096 Posts

15 April 2010 at 4:53pm

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

Avatar
churika

Community Member, 29 Posts

16 April 2010 at 1:12am

Edited: 16/04/2010 1:49am

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