Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0
rossc0

Target individual image from Portfolio gallery to redirect to separate page on site

Question

Site URL: http://www.dntl.co.uk

Hi all,

I'm hoping someone can help. I currently have a Portfolio / Gallery of images on my homepage and I'm trying to get one particular image in that gallery to link to the separate /shop section of my page rather than the current /work/merch which is currently pointing at. 

If I try to change the Slug in the settings / cog icon. I can only change the 'merch' part. It doesn't allow me select the entire line.

If I play around with inspect on Google Chrome, all I need to do is change this:

<a class="grid-item" href="/work/merch" id="yui_3_17_2_1_1592494658970_189">

to this:

<a class="grid-item" href="/shop id="yui_3_17_2_1_1592494658970_189">

And I get the desired effect, but obviously that's not a permanent change. 

I've tried, using a extremely basic knowledge of coding, to inject some code but soon found out the YUI constantly changes and can't see a 'block-id' that pertains to this particular image. 

Is there any way around this?

My client doesn't want the site live yet, so apologies that I can't show it. But hopefully I've been clear!

Any help, much appreciated. 

Cheers,

Ross

Share this post


Link to post

8 answers to this question

Recommended Posts

  • 1
// Add this code to Settings -> Advanced -> Code Injection -> Footer
<script>
(function(){
	window.addEventListener('load', function() {
	var link = document.querySelector('a[href="/work/merch"]');
    link.href = 'https://www.dntl.co.uk/shop';

})

})()
</script>

 


Philadelphia, PA

Available for hire

Beyond Copy/Paste: Learn CSS for Squarespace Workshop

Chat/Message on FB Messenger for quickest responsehttps://m.me/dejaegherryan

 

Share this post


Link to post

Create an account or sign in to comment

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


×
×
  • Create New...