Created
August 26, 2026 14:34
-
-
Save dpw1/168cbfa52b3175a1079540e3337154eb to your computer and use it in GitHub Desktop.
EZFY Shopify: custom background image section (image picker, no CDN URL)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% 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 %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% 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