Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hey guys,
I am trying to pull pics thorugh image picker, displaying as background image. I have put the code below to pull the pics from "files", but no matter what filter I use(img_url, file_img_url), it keeps trying to pull from assets which lead to have a no image there. I put the code below for you to understand:
{
"id": "one-third-image",
"type": "image_picker",
"label": "Select Image"
}
.AboutUs__one-third-image {
background: url('{{ section.settings.one-third-image | img_url }}');
max-width: 920px;
display: block;
}
Hope someone can help me with that.
Thanks
I think it's probably because you're not providing it any parameters. Try giving it like this:
.AboutUs__one-third-image {
background: url('{{ section.settings.one-third-image | img_url: "master" }}');
max-width: 920px;
display: block;
}
That'll output whatever the image's intrinsic dimensions are. You can provide it a size though:
.AboutUs__one-third-image {
background: url('{{ section.settings.one-third-image | img_url: "1920x" }}');
max-width: 920px;
display: block;
}
That would give you a 1920px wide version of whatever image you're referrencing.
I tried it out with giving parameters as well but no hope...
I'm trying to figure this out now too. Did you ever find the solution? I've been looking everywhere. Who would have thought just trying to display a background image using img_picker in a block would be so tricky.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025