By aimlesslady on Friday, 15 September 2017
Replies 25
Likes 0
Views 1.9K
Votes 0
With the monthly calendar, when you click the next month from the dropdown, it reloads the page and brings you to the top of page.Our calendar is in the middle of the page and we want it to reload and be at the calendar. Is there a way to put an anchor tag somewhere to do this?
Hi Aimlesslady,
I think the best way to do this is adding some javascript to your JEvents Pages so that they automatically scroll down to the calendar.

Another way could be creating a template override for the monthly view and adding the anchor to the generated link.

Last but not least, you may try to use ReReplacer by Regular Labs (https://www.regularlabs.com/extensions/rereplacer/features) and use some Regular Expresion to add the anchor to the links.

It depends on how do you wan to do it

Best!!
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for your feedback. I don't know enough javascript to add it.
I would do an override but I don't know what file to edit, and I don't think it is a simple html link, I think it uses javascript.
Is there anyone out there who can write the appropriate javascript for me?
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
We do not usually do custom code for Members, but this is a very tiny thing. Can you please provide a link to the page?
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I'm afraid FTP credentials are not working I get this message:
Respuesta: 331 User ebr@horizonct.net OK. Password required
Comando: PASS ********
Respuesta: 530 Login authentication failed


Also, please provide the exact URL of your site where you need this behaviour.
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Try the following info
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
FTP works now. Thank you!! Can you please provide the Exact url where you want this behaviour?
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
The home page. http://horizonsct.org/
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,
can you please provide the exact url of your calendar (not just the url of the site) where you want to implement this behaviour? It's not obvious to me and I cannot find where you want it.
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
It is on the Home page. There are about 4 module positions above the actual calendar, but it is the main page. The menu item is JEvents - Core » View by Month » View by Month and it is displayed in the Main content section.
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I could make it without a template override, just adding a Module of type Custom which is called: Javascript - Scroll to calendar.

this is the code that makes the scroll magic:


<script>jQuery(document).ready(function(){document.getElementById("jevents").scrollIntoView({'behavior': 'smooth', 'block':'start'});});</script>


Best!
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
That's beautiful, BUT, it also means that whenever you navigate to that page, it settles at the calendar, rather than at the top of the page. I need it to happen ONLY when you change months.
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I see now. Then the best approach is to override the monthly calendar and add the id to the link. I'll try to fix it tomorrow.

Best!!
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you very much
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Have you had any success?
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Sorry, it was a busy end of the week...

I have just applied the changes to your site.

Best!!
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you for your attempt, and it works if you just navigate to the next or previous month, but it still scrolls to the top of the page when you change months via the drop down selector. Can you fix that too?
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I can give you directions for that, but if you require a fix I'm afraid I would need to give you a quote for it.
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I'll give it a shot if you tell me how.
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I finally applied the changes myself. so now you can enjoy your scroll down

Best!!
·
7 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post