Liquid, JavaScript, themes, sales channels
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.
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024