Forum

Thread tagged as: Problem, Runway, Events

Events Calendar Routing Problems

Hi, sorry to bother you.

I seem to have a problem with routing the Events Calendar.

What I've Done:

In runway.php added my custom token:

'events'    =>  '[0-2][0-9]{3}\-[0-9]{2}',

On my Calendar Page added this route:

/news/exhibitions/[events:date]

Changed the calendar.html template navigation to:

<a class="nextMonth" href="/news/exhibitions/<perch:events id="next_month" format="Y-m" />">

But when I click next month it changes the URL to the next month and the page loads but the calendar is still on the current month (February 2015). I'm sure this was working last week when I was testing.

Can you see anything I'm doing wrong?

Dexter Harrison

Dexter Harrison 29 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, looks good. So is your page then looking for perch_get('date')?

I have this:

<?php
     perch_events_calendar(array(
         'filter'   => 'eventDateTime',  
         'match'    => 'eq',
         'value'    => perch_get('date'),
    ));
?>
Drew McLellan

Drew McLellan 2638 points
Perch Support

eventDateTime is a full date at time e.g. 2015-02-11 13:30:00

perch_get('date') is returning a year and month pair like 2015-02

The two will never be equal.

     $dates = perch_get('date').'01 00:00:00, '.perch_get('date').'-31 23:59:59';
     perch_events_calendar(array(
         'filter'   => 'eventDateTime',  
         'match'    => 'eqbetween',
         'value'    => $dates,
    ));

Ah yeah didn't even think about that.

And that is still doing the same thing though unfortunately. Stays on February 2015

Drew McLellan

Drew McLellan 2638 points
Perch Support

What does the debug output?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ugh, ok, I've found it. It looks like the Events app isn't going to work without a query string. I'll look at getting it updated for Runway compatibility ASAP.

No problem.

I saw your blog post on the new blocks feature. Looks great and I can't wait for it's launch!

Thanks again Drew