Image picker seeks assets folder instead of files folder. How to fix it?

batulkr
Excursionist
25 1 0

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 %}
0 Likes