Jump to content

Redirect with a code block?

Recommended Posts

Site URL: http://hcponline.squarespace.com

I'm playing around with the features of events and calendar blocks. I have a set of courses (service products in my store page) that I'd like to display in a calendar by their start dates. If I create a bunch of events with the course start date, I can add a product block to the event detail page, but the extra data field doesn't show. It would be better to redirect people from the event detail to the product detail for that course. 

I've tried adding a code block set to JavaScript, and tried entering code several ways. None of them seems to be working. Here's the latest version of the code:

<script>window.location.href="/browse-classes/p/photoshop-core-22-08-17";</script>

I'm thinking ultimately I'll want to use .location.replace() instead.

Any suggestions? The site is currently password protected, and I noticed something about scripts being disabled when you have to log when in preview. I don't think password protected is the same thing. 

Thanks!!

Edited by HCPed
Link to comment
  • Replies 1
  • Views 257
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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.