Skip to content

Instantly share code, notes, and snippets.

@dpw1
Created August 26, 2026 14:34
Show Gist options
  • Select an option

  • Save dpw1/168cbfa52b3175a1079540e3337154eb to your computer and use it in GitHub Desktop.

Select an option

Save dpw1/168cbfa52b3175a1079540e3337154eb to your computer and use it in GitHub Desktop.
EZFY Shopify: custom background image section (image picker, no CDN URL)
{% if section.settings.bg_image != blank %}
<style>
body {
background-image: url({{ section.settings.bg_image | image_url: width: 1920 }});
background-size: cover;
background-position: center;
background-attachment: fixed;
background-repeat: no-repeat;
}
</style>
{% endif %}
{% schema %}
{
"name": "Background image",
"settings": [
{
"type": "image_picker",
"id": "bg_image",
"label": "Background image"
}
],
"presets": [
{
"name": "Background image"
}
]
}
{% endschema %}
{% comment %}
Drop this near the top of an existing section file.
Also add the image_picker setting from the tutorial into that section's schema.
{% endcomment %}
{% if section.settings.section_bg_image != blank %}
<style>
#shopify-section-{{ section.id }} {
background-image: url({{ section.settings.section_bg_image | image_url: width: 1920 }});
background-size: cover;
background-position: center;
}
</style>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment