Home › Forums › Calendar Products › Events Calendar PRO › Menu link to upcoming recurring event
- This topic has 5 replies, 2 voices, and was last updated 9 years, 8 months ago by Barry.
-
AuthorPosts
-
August 8, 2014 at 10:56 am #617305peopleschurchParticipant
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.
August 11, 2014 at 7:09 am #638962BarryMemberHi – 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 π
August 11, 2014 at 1:40 pm #641807peopleschurchParticipantYeah, no problem.
Just to be clear, that means that there isn’t currently a way to do this?
August 12, 2014 at 7:23 am #650422BarryMemberThanks!
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 π
August 13, 2014 at 4:44 pm #661024peopleschurchParticipantI 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.
August 13, 2014 at 7:38 pm #662110BarryMemberReally 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!
-
AuthorPosts
- The topic ‘Menu link to upcoming recurring event’ is closed to new replies.