Jump to content

Opening GoogleCalendar events in new tab

Recommended Posts

  • Replies 23
  • Views 1k
  • Created
  • Last Reply

Top Posters In This Topic

On 3/17/2022 at 11:57 PM, MissMackay said:

Site URL: https://uvehub.com/training-and-consulting/courses/foundations-03-2022

Want a new tab to open when user clicks on the Google Calendar or ICS links for an event. Is this possible?

Add to Settings > Advanced > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$('li.eventitem-meta-item.eventitem-meta-export.event-meta-item a').attr('target','_blank');
});
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 4 months later...
On 8/6/2022 at 2:03 PM, Nikitaly said:

That's great.  How do you do the same for ical?

thanks

 

Use this new code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$('ul.eventitem-meta.event-meta.event-meta-addtocalendar-container a').attr('target','_blank');
});
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 3 weeks later...
On 3/19/2022 at 8:47 AM, tuanphan said:

Add to Settings > Advanced > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$('li.eventitem-meta-item.eventitem-meta-export.event-meta-item a').attr('target','_blank');
});
</script>

 

Hi, there's no calendar, just the links to add to google calendar or ics link

thanks again for looking

Link to comment
  • 2 weeks later...
On 9/15/2022 at 4:18 PM, Nikitaly said:

Sorry again.  Been away awhile.  Scheduling isn't active now on the test site but here's a sample page:

https://walrus-springtail-ljhd.squarespace.com/workshop-events/novemberworkshop?p

pw: 1mageproblem.

 

 

Add this to Last Line in Code Injection > Footer

<script>
$(document).ready(function() {
	$('ul.event-meta-addtocalendar-container a').attr('target','_blank');
});
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 9 months later...
On 6/23/2023 at 10:42 AM, mdesa12 said:

Was there ever a solution found for this, maybe on another forum post? I'm dealing with the same blank page issue and struggling to get a new tab open at all.

Have you tried above code yet? If it doesn't work, can you share link to event?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
7 hours ago, mdesa12 said:

yeah, i gave that a shot -- https://www.mitchellsinmanhattan.com/save-the-date

thank you!

Add this to Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$('a.eventlist-meta-export-ical').attr('target','_blank');
});
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
1 hour ago, mdesa12 said:

for the google calendar?

That code for ICS, if you need both, use this new code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$('li.eventlist-meta-item.eventlist-meta-export.event-meta-item a').attr('target','_blank');
});
</script>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
13 minutes ago, tuanphan said:

That code for ICS, if you need both, use this new code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$('li.eventlist-meta-item.eventlist-meta-export.event-meta-item a').attr('target','_blank');
});
</script>

 

ahh, there we go. thanks a ton!!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.