Shopify themes, liquid, logos, and UX
One customization request that our team has seen a lot of demand for is making the slideshow of a theme clickable. In this guide, we will go through the necessary steps to achieve this by adding some code to the Slideshow theme file. The result will have your slideshow going from this:
To this:
Step One: Edit Your Theme Code:
Go to Online Store > Current Theme > Actions > Edit Code.
Debut:
<div id="slickSlide-{{ block.id }}"
On older versions of Debut it may be <div class="slideshow__slide slideshow__slide--{{ block.id }}" {{ block.shopify_attributes }}>
3. Add this snippet of code right below it:
<style>
.slide__link {
width: 100%;
height: 100%;
position: absolute;
z-index: 9;
}
</style>
<a class="slide__link" href="{{ block.settings.button_link }}"></a>
4 Click Save.
Narrative:
<style>
.slide__link {
width: 100%;
height: 100%;
position: absolute;
z-index: 9;
}
{% if cta == blank %}
.slideshow__heading-cta.btn {
display: none;
}
{% endif %}
</style>
<a href="{{ block.settings.cta_link }}" class="slide__link"></a>
3. Click Save.
Minimal:
<style>
.slide__link {
width: 100%;
height: 100%;
position: absolute;
z-index: 2;
}
</style>
<a class="slide__link" href="{{ block.settings.button_link }}"></a>
3. Click Save.
Brooklyn, Boundless, and Simple:
<style>
.slide__link {
width: 100%;
height: 100%;
position: absolute;
z-index: 9;
}
</style>
<a class="slide__link" href="{{ block.settings.button_link }}"></a>
Venture:
<style>
.slide__link {
width: 100%;
height: 100%;
position: absolute;
z-index: 999999;
}
.hero-content__controls {
width: fit-content;
}
</style>
<a class="slide__link" href="{{ block.settings.button_link }}"></a>
<a class="slide__link" href="{{ block.settings.button_link }}"></a>
Step 2: Add your link to your slideshow:
Once you have finished editing your code you will be ready to add your link to your slideshow. To do so, go to Online Store > Themes > Customize > Slideshow and click on an image block. You will then be able to add the link under ‘Button link’.
Click Save.
If you have any questions regarding this tutorial, feel free to comment on this thread. Please note that this tutorial is for Shopify Supported themes only and that we will be unable to assist with any third-party themes.
To learn more visit the Shopify Help Center or the Community Blog.
Hey, thank you for your great tutorial. I have added the code, but when clicking on the slider image it will always reload the homepage. No matter what button link i am using. Can you help me with that? Thank you.
hello @Bo
Thank you for your tutorial. I tested and works perfectly with Debut theme.
But when I switch to my favourite "Craft" theme and want to apply for the same approach, the coding is however totally different. Could you kindly advise?
Many thanks!
kb
Hi - I tried this for the debut theme and it didn't work. I saw someone else tried using it for the debut theme too and it didn't work. Mine was pasted in the same spot as his in the picture he shared. Any suggestions?
This worked amazingly!!! I just wish I knew how to do this for image banners
Hello,
I am using the free "refresh" theme.
Is there a procedure to succeed for this theme?
Thanks in advance.
Hi,
Is it possible to have updated coding for the new Shopify "Ride" theme?
Thanks
How can I implement this with 2.0 Sense theme?
How can I add this feature to the Dawn theme?
I did this with the theme "fashe". However, I couldn't find the img or div so I had to put it under a different section. While I made the slideshow clickable, I can't figure out where to link it because it didn't add a "button link" option on the theme. Any suggestions? My shop is "nainaandnoor.com". Thank you!
User | RANK |
---|---|
154 | |
139 | |
79 | |
71 | |
62 |
Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023In this blog, we’ll be shining a light on Shopify Partners, Experts, and Affiliates. Who a...
By Imogen Sep 13, 2023