Low Search Calendar + Solspace Calendar, can't show date
I've been having trouble showing the date from a Solspace calendar event, with multiple occurrences. I'm using EE 2.10, Low Search 4.3.1, Low Search Calendar 1.0.2, SolSpace Calendar 1.8.13. (basically the latest versions of all of these)
Data model:
We have an Exhibitions channel and a Calendar Events channel. Events have a Solspace date field and a related exhibitions field. Some events are recurring.
I'm trying to show related future occurrences of events related to this exhibition. Basically I'm having trouble figuring out what combination of Solspace and Low Search tags to use to accomplish this. I tried using the example on Low Search Calendar but the event_start_date is blank on the page. I moved on to using 'calendar:method="occurrences"' and it almost works but shows the wrong date.
Code samples below.
'''
<!-- exhibitions.html -->
{exp:channel:entries channel="exhibitions" }
{embed="Exhibitions/_related_occurrences" exhibition_id="{entry_id}"}
{/exp:channel:entries}
'''
'''
<!-- _related_occurrences.html -->
{exp:low_search:results
channel="calendar_events"
orderby="event_start_date"
date_range_start="today"
date_range_end="1 year"
sort="asc"
calendar:method="occurrences"
child:calendar_event_related_exhibitio="{embed:exhibition_id}"
collection="calendar_events"
}
* {event_title}
{calendar_event_widget_info}
{occurrence_start_date format="%l, %F %n, %Y"}
{/exp:low_search:results}
'''
This should result in:
* Gallery Tour: "Ancient Egypt 101"
Join a Museum Guide for a free tour exploring the basics of Egyptian art.
Friday, June 26, 2015
* Gallery Tour
Join a Museum Guide for a free tour of the installation.
Tuesday, June 30, 2015
* Test event
Test event description.
Wednesday, July 15, 2015
* Test event
Test event description.
Tuesday, September 1, 2015
But instead results in:
* Gallery Tour: "Ancient Egypt 101"
Join a Museum Guide for a free tour exploring the basics of Egyptian art.
Friday, June 6, 2015
* Gallery Tour
Join a Museum Guide for a free tour of the installation.
Tuesday, June 6, 2015
* Test event
Test event description.
Wednesday, July 7, 2015
* Test event
Test event description.
Tuesday, September 9, 2015
So the dates are there but are all wrong by different number of days. It even lists June 6 twice, once as a Friday and once as a Tuesday when it should be a saturday.
I'm lost between all the tags of different plugins, any help is greatly appreciated!
Replies
Low 23 Jun 2015 17:21
If you just use the Results tag without the child:calendar_event_related_exhibitio parameter, does that give you the expected results?
Zack Sheppard 23 Jun 2015 18:07
Nope, that shows all calendar events. This is on the exhibition template so I only want events to show that have that exhibition in the relationship field.
The way I have it setup does show the correct events, but the dates are wrong. Maybe there is a different way to get the right events though?
Low 23 Jun 2015 19:36
Does it show the correct dates when removing that child: param, tho? Or are the dates wrong there, too?
Zack Sheppard 23 Jun 2015 21:09
When removed they show the same wrong dates, even the June 6 still shows the wrong day.
Is there a different overall approach I should try? It would even be fine to show events with their occurrences but i couldn't get either of those things working
Low 23 Jun 2015 21:14
I'm just surprised the dates are that wrong. Low Search (with Low Search Calendar installed) calls Solspace's exp:calendar:events or exp:calendar:cal or exp:calendar:occurrences tag (depending on the calendar:method="" param), which takes care of the parsing of the variables.
My approach would be to get the (unfiltered) output you want using the exp:calendar:x tag, and then swap that with the low_search:results tag with calendar:method="x", which should give the same output, but filtered by other LS params.
Zack Sheppard 23 Jun 2015 21:53
Thanks Low, I'll try that out!