Jump to content

Use same link for multiple portfolio items

Recommended Posts

Posted (edited)

I am running into an issue where I need multiple portfolio items to link to the same page, but Squarespace doesn't seem to allow that natively. Is there a code workaround for this?

Here is my portfolio page: inthewildworkshops.com/workshops

I'd like to have the multiple Norway listings go to the same general Norway information page (I would use "/workshops/norway" for the slug instead of them each having their own). Then at checkout, I'll have a dropdown where they can choose which dates/trip they'd like to sign up for. I believe this will benefit SEO instead of changing the URL of the trips every year.

Edited by autpops
  • Replies 14
  • Views 1.3k
  • Created
  • Last Reply

Top Posters In This Topic

Posted (edited)
On 5/10/2023 at 1:34 AM, tuanphan said:

You mean change 4 item urls on this page to same url?

https://www.inthewildworkshops.com/workshops

@tuanphan Thank you for responding! I'd just like the two "Northern Lights in Norway" projects on that page to link to the same URL. The URLs for those two projects right now are /workshops/norway2024-week1 and /workshops/norway2024-week2, but I'd like them both to just link to /workshops/norway, if that makes sense.

Edited by autpops
Posted
On 5/10/2023 at 11:18 PM, autpops said:

@tuanphan Thank you for responding! I'd just like the two "Northern Lights in Norway" projects on that page to link to the same URL. The URLs for those two projects right now are /workshops/norway2024-week1 and /workshops/norway2024-week2, but I'd like them both to just link to /workshops/norway, if that makes sense.

Add to Settings > Advanced > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script>
  jQuery(document).ready(function($){
  $('a.grid-item[href*="/norway2024-week"]').attr('href','/workshops/norway');
})
</script>



 

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!)

Posted (edited)
On 5/12/2023 at 1:33 AM, tuanphan said:

Add to Settings > Advanced > Code Injection > Footer

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js"></script>
<script>
  jQuery(document).ready(function($){
  $('a.grid-item[href*="/norway2024-week"]').attr('href','/workshops/norway');
})
</script>



 

@tuanphan Amazing! Thank you so much! There's just one issue, the :after content dates on the /workshops page are now the same instead of Norway Week 1 being Feb 2-8 and week 2 being Feb 11-17.

FYI I have hidden those two dates until I hear back from you for a fix.

Edited by autpops
Posted
On 5/16/2023 at 8:38 AM, autpops said:

@tuanphan Amazing! Thank you so much! There's just one issue, the :after content dates on the /workshops page are now the same instead of Norway Week 1 being Feb 2-8 and week 2 being Feb 11-17.

FYI I have hidden those two dates until I hear back from you for a fix.

Sorry for delay. Do you still need help?

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!)

Posted (edited)
2 hours ago, tuanphan said:

Which are you referring to?

image.thumb.png.21d896c6f95d6258367011a7af9b3aef.png

@tuanphanThey are all supposed to have dates under the titles, like the “Arches & Canyonlands National Parks” does in your screenshot. The two “Northern Lights in Norway” projects should have dates under them (week 1 should be February 2-8, 2024 and week 2 should be February 11-17, 2024), but I’ve hidden them for now because changing the projects to direct to the same link makes the dates appear the same (I created the dates using CSS that pulls in the URL as reference since projects don’t currently have descriptions built-in). When I turn the dates on for the two Norway projects they both say February 2-8, 2024.
 

So I just need the two Norway projects to direct to the same link, but also to be treated as two separate projects on the “workshops” page so they can have different dates as their descriptions… hopefully that makes sense.

Edited by autpops
Posted
On 5/16/2023 at 8:38 AM, autpops said:

@tuanphan Amazing! Thank you so much! There's just one issue, the :after content dates on the /workshops page are now the same instead of Norway Week 1 being Feb 2-8 and week 2 being Feb 11-17.

FYI I have hidden those two dates until I hear back from you for a fix.

You can remove this code, we will 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!)

Posted
On 5/16/2023 at 8:38 AM, autpops said:

@tuanphan Amazing! Thank you so much! There's just one issue, the :after content dates on the /workshops page are now the same instead of Norway Week 1 being Feb 2-8 and week 2 being Feb 11-17.

FYI I have hidden those two dates until I hear back from you for a fix.

This code

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!)

Posted
On 5/28/2023 at 3:09 AM, tuanphan said:

This code

@tuanphan Well, I don't want to un-hide the dates because I can't be displaying incorrect dates since the website is live. Do you want me to remove all of the date code in general? This is what I'm using:

/*portfolio grid description font*/
/* add subtitle */
h3.portfolio-title:after {
  font-family: 'NatureSpiritRough';
  font-size: 30px;
  letter-spacing: 3px;
  display: block;
  white-space: pre-wrap;
}
@media screen and (max-width: 767px) {
  h3.portfolio-title {
    font-size: 44px !important;
  }
  h3.portfolio-title:after {
    font-size: 28px;
  }
}

a.grid-item[href="/workshops/peru"] h3:after {
    content: "July 8 - 14, 2023";
}

a.grid-item[href="/workshops/rainier"] h3:after {
    content: "August 11 - 13, 2023";
}

a.grid-item[href="https://poseidonexpeditions.com/antarctica/antarctic-peninsula-best-of-antarctica/251/?utm_campaign=nate-luebbe&utm_medium=referral"] h3:after {
    content: "November 21 - December 1, 2023";
}

/*a.grid-item[href="/workshops/norway"] h3:after {
    content: "February 2 - 8, 2024";
}
a.grid-item[href="/workshops/norway-week2"] h3:after {
    content: "February 11 - 17, 2024";
}*/

a.grid-item[href="/workshops/arches-canyonlands"] h3:after {
    content: "April 1 - 5, 2024";
}

 

 

Since the code you gave me is redirecting /norway-week2 to /norway now, the a.grid-item[href] code makes both Norway dates February 2 - 8, 2024.

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.