Menu link to upcoming recurring event

Home Forums Calendar Products Events Calendar PRO Menu link to upcoming recurring event

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #617305
    peopleschurch
    Participant

    I was wondering if there is an easy way to link to the next upcoming recurring event. We would like to have a link in our navigation to link to an event that happens weekly but not need to update the link in the nav weekly. When adding an event as a menu item and searching for an event name only one event is displayed (even though I know the event is recurring) making me expect that the link automatically update even though it appears not to. We could link to /event-name/all, but it would be nice if it actually went to an event page.

    #638962
    Barry
    Member

    Hi – I can definitely see that advantage of that (linking to the next upcoming event in a chain of recurring events).

    Would you be down to post a feature request? That has the advantage of letting other users vote and show their support for the idea – we’d certainly be willing to consider this idea if there’s enough demand πŸ™‚

    #641807
    peopleschurch
    Participant

    Yeah, no problem.

    Just to be clear, that means that there isn’t currently a way to do this?

    #650422
    Barry
    Member

    Thanks!

    Just to be clear, that means that there isn’t currently a way to do this?

    There are definitely a few avenues you could explore if you want to handle it with some creativity πŸ™‚

    One could be to form menu links in the following pattern:

    example.com/events/event-name?find=next

    You could use some custom code to “listen” for that extra URL query at the end (find β†’ next) and then redirect the user to the next upcoming instance of the event. You could even go for a deluxe model if you are familiar enough with how WordPress handles endpoints, etc, and form URLs like this:

    example.com/events/event-name/next

    This would let you embed links in your nav bar etc. However, though there are no technical impediments to this sort of strategy I’m afraid it is beyond the scope of what we can guide you through here on the forum – but I do hope if nothing else it gives you an idea or two that you can explore.

    Thanks again – and we look forward to seeing your feature request πŸ™‚

    #661024
    peopleschurch
    Participant

    I have been working on creating a solution to this but keep running into a problem.

    Attempting to redirect a page like example.com/events/event-name/next results in auto redirecting to example.com/events/event-name/all no matter what wp_redirect() is set to. Attempting to redirect the main calendar page (example.com/events/next) results in a 404 page without redirecting the url (it stays example.com/events/next). The redirect will work on any other page or url ending in “/next”, but not “/events/event-name/” or “/events/next”.

    I can’t tell if this is because the event calendar is not included in the endpoint $places (i have it set to all and all_archive) or because the calendar plugin redirects are overriding my own. Do you know what this is caused by?

    I can provide my code if that would be useful, but because the redirect works on all non calendar pages I have a feeling the issue isnt within what I have written.

    #662110
    Barry
    Member

    Really a customization like this is something we need to leave in your hands – but I’d make a couple of observations here:

    Attempting to redirect a page like example.com/events/event-name/next results in auto redirecting to example.com/events/event-name/all

    The idea is not to redirect to example.com/events/event-name/next but rather to “listen” for those requests and redirect from there to a specific instance of the recurring event, like example.com/events/event-name/yyyy-mm-dd.

    I can’t tell if this is because the event calendar is not included in the endpoint $places (i have it set to all and all_archive) or because the calendar plugin redirects are overriding my own. Do you know what this is caused by?

    It’s worth bearing in mind order-of-operations issues. If for instance The Events Calendar/Event Calendar PRO’s rules are evaluated before yours that could upset the apple cart to some extent.

    I’d genuinely love to dive into this in more detail but I’m afraid we really don’t have the resources to go into detail on requests like this. I do hope the above gives you some ideas to think about, though, and hope you figure out a solution πŸ™‚

    As we can’t really go much further with this one I’ll go ahead and close the thread, but please don’t hesitate to create new threads as needed if you need assistance with anything else.

    Thanks!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Menu link to upcoming recurring event’ is closed to new replies.