Buy me a coffee

How to add Google Calendar to Squarespace

I often see two cases where people need to add Google Calendar to Squarespace.

  • Add it as a block
  • Add it as a lightbox (click a button >> show Google Calendar in a Lightbox/Popup)

A. Add Google Calendar as a block

#1. First, you need to get Google Calendar Embed code. Something like this.

Add Google Calendar To Squarespace 01 Min#2. Add a Code Block

Add Google Calendar To Squarespace 02 Min#3. Paste Google Calendar embed code to Code Block

Add Google Calendar To Squarespace 03 Min#4. Save and see the result. You will have something like this.

Add Google Calendar To Squarespace 04 Minor a button with a lightbox when clicking it.

Add Google Calendar To Squarespace 05 Min

B. Add Google Calendar as a Lightbox/Popup

It means, that when the user clicks the Header button (or Button Block or any buttons) will open Google Calendar in a Popup/Lightbox. In this case, I will use the Header button.

#1. Add your Google Calendar Embed code to the Code Injection – Footer. Something like this

Add Google Calendar To Squarespace 06#2. Use this code to Custom CSS box

button.qxCTlb {
    position: fixed;
    opacity: 0;
    transform: translateX(-1000px);
}

Add Google Calendar To Squarespace 07#3. Use this code to Code Injection Footer, under the #1 code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
$(document).on('click', 'header#header a.btn', function(event) { 
    event.preventDefault(); 
    $('button.qxCTlb').click(); 
});
</script>

Add Google Calendar To Squarespace 08#4. Edit Header button > Make sure this option “Open link in New Tab” is disabled. With the URL, you can enter any URL.

Add Google Calendar To Squarespace 09 Min#5. Result

When clicking the Header button > Google Calendar Popup will appear.

Add Google Calendar To Squarespace 10 Min