How to make a “Source URL” open in a new tab - Squarespace 7.1
If you are using a Summary Block, and linking it to a blog post, there might be times where you are using the “Source URL” otherwise known as the “Post Source URL” to allow the summary block to link off to a third party link.
If you want this to open in a new window / tab, then you need to simply add the following to the end of the URL…
/"target="_blank
Using Code
Alternatively, if you want all links in your summary block using the Post Source URL to open in a new tab, add this code to Code Injection > Footer.
<!--Post Source URL - Open in a New Tab --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> $(document).ready(function() { $('a.summary-thumbnail-container.sqs-gallery-image-container').attr('target','_blank'); }); </script>
Before - Opens in the Same Window:
https://madebydave.org
After - Opens in a New Tab / Window:
https://madebydave.org/"target="_blank
You will need to toggle on the “Link Post Title to Source URL” for the link to work generally.