Hi @JustinasR clean way to handle this is to create a custom section in your theme. Here’s a ready-to-use solution that works with Shopify Translate & Adapt too:
Steps:
- Go to Shopify Admin → Online Store → Themes → Edit Code
- Under
sections folder, create a new file: image-with-text-overlay.liquid
- Paste the code below and save
- In Theme Editor, click “Add Section” — you’ll see “Image Overlay”
Features:
- Image picker
- Heading + rich text fields (Translate & Adapt compatible)
- Text position selector (top-left, center, bottom-center etc.)
- Text color picker
- Dark overlay opacity slider
- Optional button with link
<style>
.overlay-section {
position: relative;
width: 100%;
overflow: hidden;
}
.overlay-section img {
width: 100%;
height: auto;
display: block;
}
.overlay-text {
position: absolute;
padding: 20px;
color: {{ section.settings.text_color }};
}
.overlay-text.top-left { top: 10%; left: 5%; }
.overlay-text.top-center { top: 10%; left: 50%; transform: translateX(-50%); }
.overlay-text.center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.overlay-text.bottom-left { bottom: 10%; left: 5%; }
.overlay-text.bottom-center { bottom: 10%; left: 50%; transform: translateX(-50%); }
.overlay-bg {
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;
background: rgba(0,0,0,{{ section.settings.overlay_opacity | divided_by: 100.0 }});
}
</style>
<div class="overlay-section">
{% if section.settings.image %}
{{ section.settings.image | image_url: width: 1500 | image_tag: loading: 'lazy' }}
{% endif %}
<div class="overlay-bg"></div>
<div class="overlay-text {{ section.settings.text_position }}">
{% if section.settings.title != blank %}
<h2>{{ section.settings.title }}</h2>
{% endif %}
{% if section.settings.text != blank %}
<div>{{ section.settings.text }}</div>
{% endif %}
{% if section.settings.button_label != blank %}
<a href="{{ section.settings.button_link }}" style="display:inline-block; margin-top:10px; padding:10px 20px; background:{{ section.settings.text_color }}; color:#000; text-decoration:none;">
{{ section.settings.button_label }}
</a>
{% endif %}
</div>
</div>
{% schema %}
{
"name": "Image Overlay",
"settings": [
{ "type": "image_picker", "id": "image", "label": "Image" },
{ "type": "text", "id": "title", "label": "Heading", "default": "Your Heading" },
{ "type": "richtext", "id": "text", "label": "Description", "default": "<p>Your text here</p>" },
{ "type": "text", "id": "button_label", "label": "Button Label" },
{ "type": "url", "id": "button_link", "label": "Button Link" },
{
"type": "select",
"id": "text_position",
"label": "Text Position",
"options": [
{ "value": "top-left", "label": "Top Left" },
{ "value": "top-center", "label": "Top Center" },
{ "value": "center", "label": "Center" },
{ "value": "bottom-left", "label": "Bottom Left" },
{ "value": "bottom-center", "label": "Bottom Center" }
],
"default": "center"
},
{ "type": "color", "id": "text_color", "label": "Text Color", "default": "#ffffff" },
{
"type": "range",
"id": "overlay_opacity",
"min": 0, "max": 80, "step": 5, "unit": "%",
"label": "Dark Overlay Opacity",
"default": 30
}
],
"presets": [{ "name": "Image Overlay" }]
}
{% endschema %}
And also if this will work then don’t forget to like and mark as solution on it