"Back To Calendar" to go to last month/year user queried?

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.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1256887
    dcranch
    Participant

    Hello –

    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

    #1257659
    Andras
    Keymaster

    Hello 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.php

    here:

    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( '&laquo; ' . 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( '&laquo; ' . 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,
    Andras

    #1261678
    dcranch
    Participant

    I 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

    #1262865
    dcranch
    Participant

    Anyone?

    #1264427
    Andras
    Keymaster

    Hey 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,
    Andras

    #1274740
    Support Droid
    Keymaster

    Hey 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘"Back To Calendar" to go to last month/year user queried?’ is closed to new replies.