Open external link in new tab
In theme.liquid, insert the following before </body>
<script>
document.addEventListener('DOMContentLoaded', function() {
var links = document.links;
for (let i = 0, linksLength = links.length; i < linksLength; i++) {
if (links[i].hostname !== window.location.hostname) {
links[i].target = '_blank';
links[i].rel = 'noreferrer noopener';
}
}
});
</script>
Related Articles
Make parent link clickable
Snippets > header-mega-menu.liquid (l.19-25) Parentlink {%- assign parentlink = link.links[0] -%} <a href="{{ parentlink.url }}" title="{{ parentlink.title }}"> <span {%- if link.child_active %} class="header__active-menu-item" {% endif %} > {{- ...
Poplink Link form issue on hero section
In css, add the followings: .popup-link__content--drawer { z-index: 9999 !important; pointer-events: auto; }
Reduce menu link padding in the footer
In the footer section, add the following in the custom css: .list-menu__item--link { padding: 0px; }
Video carousel with product link
{% doc %} @prompt I want a video carousel block with the followings: - unlimited videos, preferably adding thru the section - product thumbnail with product link, when click it goes to product page - desktop column: 3,4,5 - mobile column: 1,2 - ...
Add padding and button style to popup link
Add CSS: .popup-link__button { background-color: #013a34; color: white; border-radius: 15px; } .popup-link__button:hover { background: black; color: white; } .popup-link__content--drawer { background-color: #e5e5e5; }