Shopify themes, liquid, logos, and UX
I am using Dawn 2.0 and changed my slideshow.liquid file so that the entire image is a link. However, when I did that, the header submenu links no longer work (you can click on the submenu items, but it's like they are invisible because it will go to the link from the slideshow image, which is underneath the submenu).
I have tried changing the z-index, but I can't get it to work correctly. My site is www.palmettowoodshop.com and here's the relevant code from my slideshow.liquid section:
<div class="slideshow__media banner__media media{% if block.settings.image == blank %} placeholder{% endif %}">
{%- if block.settings.image -%}
<a class="full-link" href="{{ block.settings.link }}"></a>
<img
srcset="{%- if block.settings.image.width >= 375 -%}{{ block.settings.image | img_url: '375x' }} 375w,{%- endif -%}
{%- if block.settings.image.width >= 550 -%}{{ block.settings.image | img_url: '550x' }} 550w,{%- endif -%}
{%- if block.settings.image.width >= 750 -%}{{ block.settings.image | img_url: '750x' }} 750w,{%- endif -%}
{%- if block.settings.image.width >= 1100 -%}{{ block.settings.image | img_url: '1100x' }} 1100w,{%- endif -%}
{%- if block.settings.image.width >= 1500 -%}{{ block.settings.image | img_url: '1500x' }} 1500w,{%- endif -%}
{%- if block.settings.image.width >= 1780 -%}{{ block.settings.image | img_url: '1780x' }} 1780w,{%- endif -%}
{%- if block.settings.image.width >= 2000 -%}{{ block.settings.image | img_url: '2000x' }} 2000w,{%- endif -%}
{%- if block.settings.image.width >= 3000 -%}{{ block.settings.image | img_url: '3000x' }} 3000w,{%- endif -%}
{%- if block.settings.image.width >= 3840 -%}{{ block.settings.image | img_url: '3840x' }} 3840w,{%- endif -%}
{{ block.settings.image | img_url: 'master' }} {{ block.settings.image.width }}w"
sizes="100vw"
src="{{ block.settings.image | img_url: '1500x' }}"
loading="lazy"
alt="{{ block.settings.image.alt | escape }}"
width="{{ block.settings.image.width }}"
height="{{ block.settings.image.width | divided_by: block.settings.image.aspect_ratio | round }}"
>
{%- else -%}
{{ 'lifestyle-2' | placeholder_svg_tag: 'placeholder-svg' }}
{%- endif -%}
</div>
<style>
a.full-link {
z-index: 3;
}
</style>
Solved! Go to the solution
This is an accepted solution.
Hi add this code to your base.css
#shopify-section-header {
z-index: 9;
}
This is an accepted solution.
Figured it out. Your code works, it just needs to go in header.liquid, not base.css. Thanks!
This is an accepted solution.
Hi add this code to your base.css
#shopify-section-header {
z-index: 9;
}
I put that code in the base.css exactly as you wrote it, but it didn't change anything.
This is an accepted solution.
Figured it out. Your code works, it just needs to go in header.liquid, not base.css. Thanks!
I wrote the above solution as mentioned but, it still not working on my dawn theme, please help me in this I'm stuck!
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024