Liquid, JavaScript, themes, sales channels
Hello everyone,
I have created a custom newsletter section for a page and then wanted to use that newsletter section in another page, I implemented everything properly to the other page(hopefully) but the image picker does not work as it works in the other page. When I inspect the element on the browser, it shows that url looks for assets folder instead of searching the picture in the files folder since the image picker pulls the pictures from there. I tried to write file_img_url too but it didnt seem to work. What is wrong with that? How should I fix it?
Here is the code:
{%- assign content = section.settings.content -%}
{%- assign newletterBackground = section.settings.newsletter-background -%}
<style>
.custom-newsletter-section{
background: url('{{ newsletterBackground | img_url: '1420x350'}}') no-repeat;
background-size: cover;
}
</style>
<section class="section-newsletter container-wrap custom-newsletter-section" data-section-type="newsletter" data-section-id="{{ section.id }}">
<div class="container signUp">
<div class="row">
{%- if title != blank -%}
<h2 class="newsletter__Title">{{ title }}</h2>
{%- endif -%}
{%- if content != blank -%}
<div class="signUp-body newsletter__text">{{ content }}</div>
{%- endif -%}
{%- render 'newsletter' -%}
</div>
</div>
</section>
{% schema %}
{
"name": "Blog Post Header",
"settings": [{
"type": "header",
"content": "Blog Post Header"
},{
"type": "header",
"content": "Newsletter"
},
{
"type": "image_picker",
"id": "newsletter-background",
"label": "Background"
},
{
"type": "text",
"id": "title",
"label": "Heading",
"default": "Newsletter"
},
{
"type": "richtext",
"id": "content",
"label": "Subheading",
"default": "<p>Let's keep in touch</p>"
}]
}
{% endschema %}
Thanks for any reply.
Batuhan
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024