Jump to content

Making images on event page link to an external URL.

Recommended Posts

Hi all,

My organization runs events through a service called Classy. You can see an example page of an event here: https://give.asianhalloffame.org/event/19th-asian-hall-of-fame-induction-ceremony/e520197.

I would like to use the Squarespace event page as a one-stop listing of all our upcoming events as well as a backend that keeps track of our past events. However, as is, it seems that clicking the images on the page link to another Squarespace page. I would like images to link instead to external pages such as the example page above. Is there a way to do that?

Here is a link to our current WIP events page: https://www.asianhalloffame.org/events

Edited by AsianHOF
Added WIP events page url.
Link to comment

I just wrote a quick guide, you can see. Tested on 7.1 Event Page.

#1. Hover on 3 dots > Click Settings

Event Detail Banner03 Min

#2. Enter a text in Except

Event External Url1 Min#3. Highlight it > Click Link icon

Event External Url2 Min

And add external url > Apply

Event External Url3 Min

Then Save

Event External Url4 Min

Result

Event External Url5 Min

#4. Add this code to Website Tools (under Not Linked) > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
$("h1.eventlist-title").click(function() {
  window.open($(this).siblings(".eventlist-excerpt").find('p a').attr('href'), '_blank');
  return false;
});
$('a.eventlist-column-thumbnail').click(function() {
  window.open($(this).siblings(".eventlist-excerpt").find('p a').attr('href'), '_blank');
  return false;
});  
  $('a.eventlist-button').click(function() {
  window.open($(this).siblings(".eventlist-excerpt").find('p a').attr('href'), '_blank');
  return false;
});  
</script>
<style>
.eventlist-excerpt a {
    display: none;
}
</style>

the code will hide Excerpt Text URL + Change Button/Title/Image link to External Text URL

image.thumb.png.1a6bcf55f5f4e46f0bd5ed5c2fe74733.png

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
On 12/16/2023 at 1:08 AM, AsianHOF said:

Hi tuanphan.

Thanks so much for your help! While the code works great for making the title and the view event buttons direct to external links, clicking the image seems to only go to an empty page with "about:blank" listed in the URL.

https://www.asianhalloffame.org/events

Here's the page so you can see it.

Can you remove the code? I can check it again easier

 

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 month later...
On 12/18/2023 at 3:41 PM, AsianHOF said:

Thanks for your continued help! I removed the code as you requested.

 

On 1/23/2024 at 1:00 PM, Nico13 said:

Hi! I am having the same issue. By clicking on the image, it takes me to a blank page. 

Any way to solve this issue? 

Thanks!

 

 

Use this new code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
$(document).ready(() => {
    const a = $('.eventlist-event')
    for (let i=0; i<a.length; i++) {
        const newH = $(a[i]).find("a:contains('view external url')").attr('href');
        $(a[i]).find('a').click((e) => {
            e.preventDefault()
            window.open(newH)
        })
    }
})
</script>
<style>
.eventlist-excerpt a {
    display: none;
}
</style>

 

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
  • 2 months later...

Too bad that the Source URL on events does not have option to replace link like Blog post 😕

image.png.7afb15395c688336ab9a78edafb0678c.png

Edited by Beyondspace

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

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.