Different image paths between environments

New Member
1 0 0

I have two different sites, a development site and a staging site, with the same theme. I also have my theme files on git. I merge my development branch to my staging branch but I get a lot of conflicts with image paths. 

For example, some css code will conflict
staging:          .contact-address { float:left;width:100%; background:url(//cdn.shopify.com/s/files/1/0553/6117/5731/t/44/assets/contact_bg_img.png?29198) no-repeat; }
development:.contact-address { float:left;width:100%; background:url(//cdn.shopify.com/s/files/1/0196/8186/9924/t/70/assets/contact_bg_img.png?36011) no-repeat; }

The images are the same its just that the location changes because they're different stores. If I merge the changes then the image location will be incorrect.
I'm not sure on how deal with this issue. Has anyone dealt with this? Any ideas?

Reply 1 (1)
Shopify Partner
1985 330 405

Hi @yellowbottle,

This images are the same, if you can put the same link, it will display well.

Or you can create css in layout/theme.liquid file, it will be better if you link like that in css file.

Ex: https://i.imgur.com/4uqXIdV.png


.contact-address { float:left;width:100%; background:url({{ 'contact_bg_img.png' | asset_url }}) no-repeat; }

Hope it helps!

If my answer can help you solve your issue, please mark it as a solution. Thank you and good luck

LitExtension - #1 Shopping Cart Migration Expert
If our answer is helpful then please accept as solution!
Are you looking for a solution to migrate to Shopify? Contact us for further assistance.
Try our FREE DEMO now!