Jump to content

Have Portfolio Link to External Sites Instead of Default Portfolio Pages

Recommended Posts

Hi there, 

I'm trying to create a page on my website to display my website work. Rather than creating individual pages within the portfolio for each site, I'd rather just have it link to the sites themselves. Is there a way to do this without URL mapping?

I followed this thread - 

However, I have the Squarepaste Portfolio Filter Code in place so the code from the above thread did not work with the filter.  

Here is the page - https://studioeleven11.co/websites

My developer is OOO atm & I'd like to get this up this weekend so thank you in advance!

Link to comment

If you use Universal Filter Plugin to add dropdown filters, you can follow these steps to change url

I did an example for Project 01, Project 02 here

https://thung.squarespace.com/portfolio-filter?noredirect

pass: abc

(1) Add hooks code to this position

 hooks: {
          	onFilter: function (f) {
                        externalLink(f);
                    }
          }

image.png.1311d8910d9d7e75b5869cbfca161885.png

(2) Add jQuery code above Universal Filter Plugin code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>

(3) Add this code to on top of Filter Plugin code, but under <script> tag

 var externalLink = function (f) {
       $('a.grid-item[href="/portfolio-filter/project-one-j5z9d"]').attr('href','https://google.com');
    $('a.grid-item[href="/portfolio-filter/project-two-j6ehw"]').attr('href','https://amazon.com');
    $('a.grid-item').attr('target','_blank');
    };

image.png.4703336bb7c94b0656bdd32e396cc004.png

(4) red arrow is Portfolio Item URL

image.png.20cb96185f16cd4483db01f75d4536eb.png

image.thumb.png.31218cc1da03ba55c2eac6c302b87505.png

 

image.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
  • 3 months later...
On 6/18/2024 at 12:41 AM, dnmddy said:

@tuanphanI've followed the above steps and triple checked them but it's not working,,

https://www.drewdenny.com/

first portfolio item, "Second Nature"

The code for Portfolio Page use Universal Filter Plugin Only

with standard Portfolio Page, no Filter plugin, use this code to Code Injection Footer or Page Header Code Injection.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
	$('a.grid-item[href="/portfolio/second-nature"]').attr('href','https://google.com');
});
</script>

replace Google with new url

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

@tuanphan that duplicated the portfolio item in the grid so now there is the one that links off site and one next to it that links to the project page. Also doesnt work on the portfolio filtered page. I believe I am in fact using the universal filter plugin. 

 

 

Screenshot 2024-06-24 at 1.52.37 PM.png

Link to comment

I remember the page doesn't install Filter on June 19 (or you have problem so Filter doesn't run on that time)

Now with filter plugin, page source code changed so it won't work. You can follow code in top comment again, replace corresponding url in (3) and (4).

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

Dear @tuanphan, 

Hope you're well! I have a similar question to which I didn't find a solution yet. I have created a portfolio page (layout: hover background) where the background shows an image of the client when hovering on the clients name. However, I want to link the clients name to their website instead of an new portfolio page. 

I know there are different sorts of gallery sections existing out there as well, it could perhaps be easer to create/forward me a code where I use a 'classical' gallery section with full bleed to serve as background that changes when hovering over text in a text block. Not sure about what you think would be the best solution for this, you're wiser than me on this. 

Page: https://pigeon-orange-9lng.squarespace.com/
Password: abc

Many thanks in advance! 

Link to comment
On 10/7/2024 at 8:41 PM, TFV said:

Dear @tuanphan, 

Hope you're well! I have a similar question to which I didn't find a solution yet. I have created a portfolio page (layout: hover background) where the background shows an image of the client when hovering on the clients name. However, I want to link the clients name to their website instead of an new portfolio page. 

I know there are different sorts of gallery sections existing out there as well, it could perhaps be easer to create/forward me a code where I use a 'classical' gallery section with full bleed to serve as background that changes when hovering over text in a text block. Not sure about what you think would be the best solution for this, you're wiser than me on this. 

Page: https://pigeon-orange-9lng.squarespace.com/
Password: abc

Many thanks in advance! 

You can use this code to Website Tools > Code Injection > Footer. This is code for first 3 items, you can repeat similar for other items.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
jQuery(document).ready(function($){
  $('a.portfolio-hover-item[href="/home/maruani-mercier"]').attr('href','https://google.com');
 $('a.portfolio-hover-item[href="/home/jozef-wouters"]').attr('href','https://ebay.com');
  $('a.portfolio-hover-item[href="/home/pierre-marie-giraud"]').attr('href','https://amazon.com');
})
</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!)

Link to comment
On 10/9/2024 at 10:15 AM, tuanphan said:

You can use this code to Website Tools > Code Injection > Footer. This is code for first 3 items, you can repeat similar for other items.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
jQuery(document).ready(function($){
  $('a.portfolio-hover-item[href="/home/maruani-mercier"]').attr('href','https://google.com');
 $('a.portfolio-hover-item[href="/home/jozef-wouters"]').attr('href','https://ebay.com');
  $('a.portfolio-hover-item[href="/home/pierre-marie-giraud"]').attr('href','https://amazon.com');
})
</script>

 

Thanks, you're a hero!
Can you add something to the code so that the links open in a new web page?
Many thanks! 

Link to comment
On 10/14/2024 at 8:14 PM, TFV said:

Thanks, you're a hero!
Can you add something to the code so that the links open in a new web page?
Many thanks! 

You can use this

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script>
jQuery(document).ready(function($){
   $('a.portfolio-hover-item').attr('target','_blank');
  $('a.portfolio-hover-item[href="/home/maruani-mercier"]').attr('href','https://google.com');
 $('a.portfolio-hover-item[href="/home/jozef-wouters"]').attr('href','https://ebay.com');
  $('a.portfolio-hover-item[href="/home/pierre-marie-giraud"]').attr('href','https://amazon.com');
})
</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!)

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.