Jump to content

How to Change "Back to All Events" Button Text for Past Events Only?

Recommended Posts

Posted

Site URL: https://www.offbeatoxford.co.uk/

Hi everyone,

I'm working on a client site using Squarespace and I need help with customising the "Back to All Events" button on our events pages. Here’s the issue I’m facing:

  • I had formerly set the site up so that when an event expires, it gets filtered out of the main events page and moved to the "Supported Artists" page, however this wasn't working as I wanted it to so I have created a temporary solution.
  • On individual event pages, there's a "Back to All Events" button at the top, which takes users back to the main events page.
  • On past event pages, I want the button to say "Back to Supported Artists" and link back to the "Supported Artists" page.
  • On current event pages, the button should remain unchanged and continue to say "Back to All Events" linking to the main events page.

The challenge:

  • The URL structure for past and current events is the same, so I can't use the URL to differentiate between them.

I've tried inspecting the HTML on both past and current event pages but haven’t found an obvious way (like a unique class or data attribute) to target past events specifically. Has anyone encountered a similar situation, or is there a specific way to identify and target past events using JavaScript or CSS?

Any advice or guidance on how to structure the code to target only past events would be greatly appreciated!

Thanks in advance for your help!

All the best,

Sarah

  • Replies 1
  • Views 484
  • 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.