Can "Next Events" append the next events to bottom of list rather than replace?

Home Forums Calendar Products Events Calendar PRO Can "Next Events" append the next events to bottom of list rather than replace?

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1141745
    David
    Participant

    I am being asked this question and thought I saw somewhere once when we were looking at ECP initially that this could be done, but since I’m not finding any info on it, I may have it mixed up with something else (likely).

    Is it possible, when you click “Next Events” to have them load in under the ones already showing, rather than load in the next however many in place of those that were showing initially?

    Thanks

    #1141750
    David
    Participant

    If the above is not possible and the next set of events need to replace the previous, how do we make it so when we click “Next Events”, the browser scrolls up to the top of the list of events and not the top of the page?

    #1141751
    David
    Participant

    This reply is private.

    #1141895
    Geoff
    Member

    Hi David, thanks for getting in touch and welcome back.

    I tried looking for a snippet that might help, but came up short. I think the idea of loading in more events when clicking “Next Events” instead of reloading the page is possible, but will definitely take a fair amount of custom development. While we’re limited in how much we can support questions like these, we do have a list of folks we’d recommend to help build that functionality.

    You had also asked about the possibility of anchoring to the top of the list when the page reloads instead of the very top of the page. To do that, you would need to add an anchor to the top of the list and append that anchor to the Next Events link.

    You can find the template for the Map View here:
    /wp-content/plugins/events-calendar-pro/src/views/pro/map/content.php

    …and the template for the Next Events link here:
    /wp-content/plugins/events-calendar-pro/src/views/pro/map/nav.php

    Override those templates (more on this in our Themer’s Guide) so you don’t lose your changes on plugin updates.

    Sorry I don’t have a concrete solution for you here, but does this at least help get your started? Please let me know.

    Thanks!
    Geoff

    #1142016
    David
    Participant

    Hi Geoff,

    Thanks for the advice, we’ll think about the append thing for a later phase of the site.

    I tried adding an anchor to the top of the list like you mention and then customizing nav.php to link to that anchor, but it is not taking me to the anchor at the top of the list, but still to to the top of the entire page.

    I tested this by creating another anchor link beside the “Next Events” button and it is working properly.

    Any other reason the “Next Events” button would ignore that anchor and go all the way up? I’ll post the page below as a private post.

    Thanks
    Dave

    #1142017
    David
    Participant

    This reply is private.

    #1142122
    Geoff
    Member

    Hey David, thanks for following up!

    I would make one small change…

    You can remove this from your nav.php template:

    x

    …and replace this:

    <?php printf( __( 'Next %s <span>&raquo;</span>', 'tribe-events-calendar-pro' ), $events_label_plural ); ?>

    …with this:

    <?php printf( __( 'Next %s <span>&raquo;</span>', 'tribe-events-calendar-pro' ), $events_label_plural ); ?>

    I just tried that out on my test site and it seemed to do the trick. Let me know if it does for you as well.

    Cheers!
    Geoff

    #1142139
    David
    Participant

    Hi Geoff,

    Thanks for the suggestion, but this is still taking me to the top of the page, rather than the top of the list, where the anchor is.

    We are trying to get it so that “Upcoming Events” is at the very top of the browser window when you click, so that you’d have to scroll up to see the map and menu above it.

    The good news is, this is the last thing we need to accomplish and we will be out of EC’s hair after this! (for a while, anyhow)

    Dave

    #1142385
    Geoff
    Member

    Shoot, sorry David. That seems to be working on my end, so I was really hoping it would work for you as well.

    I’m afraid that is the only solution I can think of. Perhaps try checking the code once again and, if nothing else, use that idea as a blueprint for other methods.

    So sorry I don’t have a concrete solution for you here! I’d be happy to leave this thread open for a while in case I run into another idea or others from the community have anything to contribute.

    Geoff

    #1143457
    David
    Participant

    Hi again Geoff,

    I was talking to a more knowledgeable (than me) friend about this and he wondered if there could be a way to add an #anchor to the end of the url that is generated by clicking “Next Events”, such as this:

    http://domain.com/calendar/?action=tribe_geosearch&tribe_paged=2&tribe_event_display=map#anchor

    When I use link with that #anchor (with my domain obviously), the page will go to the anchor indicated.

    Is there a way to add that to the link somehow? Where/how is that link being generated?

    Thanks
    Dave

    #1143651
    Geoff
    Member

    Hey Dave,

    That’s a good friend you have and pretty much what we’ve been trying to do here together., by adding an ID to the Next Events link that targets a specific ID on the page.

    The link itself is in the pro/map/nav.php template on line 32:

    <?php printf( __( 'Next %s <span>&raquo;</span>', 'tribe-events-calendar-pro' ), $events_label_plural ); ?>

    The hash in there is then rendered through Javascript so that it paginates in sequential order. So, you may need to edit the Javascript files–or write a new script–that appends that anchor when clicked.

    Geoff

    #1152126
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Can "Next Events" append the next events to bottom of list rather than replace?’ is closed to new replies.