Home › Forums › Calendar Products › Events Calendar PRO › "Back To Calendar" to go to last month/year user queried?
- This topic has 6 replies, 2 voices, and was last updated 9 years ago by
dcranch.
-
AuthorPosts
-
March 20, 2017 at 2:24 pm #1256887
dcranch
ParticipantHello –
If a user searches events in a month in the future, then clicks on an event from that date query, is it possible for them to return to that search query with the “Back to calendar” button? Currently it just takes the user back to the current month view instead of the month/date they were just looking up.
Thanks,
Matt
March 21, 2017 at 4:23 pm #1257659Andras
KeymasterHello Matt,
Thanks for reaching out with your question. It’s a good one!
I believe if you click on the back button of your browser, it will take you back to the page where you left from. Is that what you are looking for?
If that is what you would like to achieve, then you could do that with a simple template override. Here’s how to do that:
1. Make a copy of:
wp-content\plugins\the-events-calendar\src\views\single-event.phphere:
wp-content\themes\[your-theme]\tribe-events\single-event.php
2. Open the copied file and change row 28 from this:
<a href="<?php echo esc_url( tribe_get_events_link() ); ?>"> <?php printf( '« ' . esc_html_x( 'All %s', '%s Events plural label', 'the-events-calendar' ), $events_label_plural ); ?></a>to this:
<a href="javascript:history.back();"> <?php printf( '« ' . esc_html_x( 'All %s', '%s Events plural label', 'the-events-calendar' ), $events_label_plural ); ?></a>This should do the trick. Let me know if that helps.
Cheers,
AndrasMarch 29, 2017 at 12:44 pm #1261678dcranch
ParticipantI followed your directions and see that the back button will take the user back and the query date stays in the date search field, however, the actual month view goes back to the current month instead of the last searched month.
Any other ideas?
Thanks,
Matt
March 31, 2017 at 3:24 pm #1262865dcranch
ParticipantAnyone?
April 4, 2017 at 2:51 pm #1264427Andras
KeymasterHey Matt,
Had some discussions with the team how this could be done and got 2 more ideas:
1. Set a cookie on window unload. Then, PHP side, when the single event page is requested, check if that piece of data is available then sanitize and display it.
2. Could probably be done purely from PHP or purely from JS and get results that are mostly acceptable.
Please note that we are limited in supporting customizations. Per our terms and conditions we support features of the plugins and although we try to help get you started on customizations for the most part you are going to have to take it on to complete.
Let me know if you have any follow up questions.
Thanks and cheers,
AndrasApril 26, 2017 at 9:35 am #1274740Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘"Back To Calendar" to go to last month/year user queried?’ is closed to new replies.
