aeb556 Posted January 25, 2023 Share Posted January 25, 2023 Hi all, I could use some advice on fixing a link on my website (the link for Broadway World). I'm trying to make it open in a new tab instead of diverting from my website. When I go into the link editor, I can turn on the option to make it open in a new window, but that setting never saves. It always defaults back to opening in the same tab. Has anyone else encountered this problem/figured out a solution? Thanks! Link to comment
tuanphan Posted January 26, 2023 Share Posted January 26, 2023 Hi, What is your site 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
aeb556 Posted February 9, 2023 Author Share Posted February 9, 2023 Hi, the page is Romeo & Juliet — Avery Banks (avery-banks.com) Thanks! Link to comment
tuanphan Posted February 10, 2023 Share Posted February 10, 2023 On 2/9/2023 at 9:01 AM, aeb556 said: Hi, the page is Romeo & Juliet — Avery Banks (avery-banks.com) Thanks! If option doesn't work, you can add this to Settings > Advanced > Code Injection > Footer <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> <script> $(document).ready(function() { $('.html-block [href*="broadway"]').attr('target','_blank'); }); </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
Jorchard Posted May 31, 2023 Share Posted May 31, 2023 I'm having the same issue, did you manage to fix? Link to comment
tuanphan Posted June 3, 2023 Share Posted June 3, 2023 On 5/31/2023 at 8:05 PM, Jorchard said: I'm having the same issue, did you manage to fix? You can use above 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!) Link to comment
nataliaamelia Posted January 22 Share Posted January 22 Hi, Is this code good for all links when added? I want all my links to open in a new window. thanks! On 6/4/2023 at 1:28 AM, tuanphan said: You can use above code Link to comment
tuanphan Posted January 23 Share Posted January 23 16 hours ago, nataliaamelia said: Hi, Is this code good for all links when added? I want all my links to open in a new window. thanks! All links, or all external links only? If all links, use this new code <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> <script> $(document).ready(function() { $('a').attr('target','_blank'); }); </script> nataliaamelia 1 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
nataliaamelia Posted January 23 Share Posted January 23 11 hours ago, tuanphan said: I emant external links thanks! All links, or all external links only? If all links, use this new code <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> <script> $(document).ready(function() { $('a').attr('target','_blank'); }); </script> Link to comment
tuanphan Posted January 24 Share Posted January 24 15 hours ago, nataliaamelia said: If external links, use this <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script> $(document).ready(function() { $('a').attr('target', function() { if(this.host == location.host) return '_self' else return '_blank' }); }); </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
Arsel Posted February 25 Share Posted February 25 On 1/23/2024 at 9:11 AM, tuanphan said: All links, or all external links only? If all links, use this new code <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script> <script> $(document).ready(function() { $('a').attr('target','_blank'); }); </script> What if files do not open in a new window? I tried this code, but it doesn't work for files. The same problem with the option 'Open in new tab', I click and it doesn't save. Link to comment
tuanphan Posted February 26 Share Posted February 26 18 hours ago, Arsel said: What if files do not open in a new window? I tried this code, but it doesn't work for files. The same problem with the option 'Open in new tab', I click and it doesn't save. Can you share link to page where you use files? I can check its id 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
JDSTAREK Posted March 8 Share Posted March 8 Maybe instead of a code injection...Squarespace could just make the toggle button work? Crazy, right? I simply want the materials visitors downloaded to open in a new tab. This isn't a big ask. There is already a toggle specifically for this...but it doesn't work. It would take a dev at Squarespace an hour to fix this... PaisleyParvatiDevi and Vale2607 1 1 Link to comment
PaisleyParvatiDevi Posted May 30 Share Posted May 30 On 3/7/2024 at 8:59 PM, JDSTAREK said: Maybe instead of a code injection...Squarespace could just make the toggle button work? Crazy, right? I simply want the materials visitors downloaded to open in a new tab. This isn't a big ask. There is already a toggle specifically for this...but it doesn't work. It would take a dev at Squarespace an hour to fix this... I agree. Having the same problem. PDF does not open to a new tab. Every time I toggle on, it does not save correctly. https://youareloved.one/ebook Link to comment
Vale2607 Posted June 15 Share Posted June 15 (edited) I have the same problem and it is driving me nuts. I am on Sonora template and I have forms for people to fill in to download a PDFs. The form works but on hitting the submit button the pdf opens in the same tab (😨😨🫣😳)! Double and trebled checked the toggle and it looks on, but still is not doing what is supposed to do! Has anybody found a solution that actually works? Grateful for any insights.. Edited June 15 by Vale2607 Added information about the template I am using. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment