Home › Forums › Calendar Products › Events Calendar PRO › Can "Next Events" append the next events to bottom of list rather than replace?
- This topic has 12 replies, 4 voices, and was last updated 7 years, 8 months ago by David.
-
AuthorPosts
-
July 19, 2016 at 4:48 pm #1141745DavidParticipant
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
July 19, 2016 at 4:56 pm #1141750DavidParticipantIf 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?
July 19, 2016 at 4:57 pm #1141751DavidParticipantThis reply is private.
July 20, 2016 at 7:41 am #1141895GeoffMemberHi 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.phpOverride 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!
GeoffJuly 20, 2016 at 10:20 am #1142016DavidParticipantHi 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
DaveJuly 20, 2016 at 10:22 am #1142017DavidParticipantThis reply is private.
July 20, 2016 at 1:32 pm #1142122GeoffMemberHey David, thanks for following up!
I would make one small change…
You can remove this from your nav.php template:
…and replace this:
…with this:
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!
GeoffJuly 20, 2016 at 2:03 pm #1142139DavidParticipantHi 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
July 21, 2016 at 7:37 am #1142385GeoffMemberShoot, 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
July 23, 2016 at 5:26 pm #1143457DavidParticipantHi 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
DaveJuly 25, 2016 at 8:20 am #1143651GeoffMemberHey 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:
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
August 16, 2016 at 9:35 am #1152126Support DroidKeymasterThis 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. -
AuthorPosts
- The topic ‘Can "Next Events" append the next events to bottom of list rather than replace?’ is closed to new replies.