How to Add Open Link in New Window Functionality

Highlighted
Tourist
4 0 1

Hi - I'm working with the Simple theme and am planning on updating the About page to redirect to an external site when clicked on. I figured out how to do so, but would like the redirect to open in a separate window instead of taking visitors away from my store. Any thoughts on how I can implement? Thank you for the help. -Phil

0 Likes
Highlighted
Tourist
8 0 4

Hey Phil,

 

I found this guide on how to have external links open in a new tab.

https://help.shopify.com/themes/customization/navigation/open-external-links-in-new-browser

also I found this snippet from Google interesting as well.

The short answer is: just add a target="_blank" attribute to your links (anchor tags). Now when your visitors click that link, it will open in a new window or tab (depending on which web browser they are using and how they configured that browser).

It seems like wether or not the link opens in a tab or a new window depends on which browser is used to view your site. FWIW I feel a tab is a better option as your store is still listed in the neighboring tab instead of being hidden by a new window. Just my $0.02.

 

Hope this helps 

4 Likes
Highlighted
Tourist
4 0 1

Thank you - worked perfectly.

1 Like
Highlighted
New Member
2 0 0

Hi. What if I wanted to add this functionality to any menu item, even if it's not external. To be clear, I only want to add it to one main menu item (a store locator or parts finder page).

0 Likes
Highlighted
Tourist
3 0 0

This solved my problem in under 2 minutes, thank you so much!! :)

0 Likes