Solved! Go to the solution
This is an accepted solution.
Hi tobitobin,
It seems to me like your logic is correct, but I noticed the following:
I think the below code should work, or at least come close to what you need. I've wrapped it in an IIFE to isolate the variables created.
{% for tag in product.tags %}
{% if tag contains 'meta_Image' %}
{% assign url = tag | split: 'meta_Image:' | last %}
<script>
(function() {
var m_Image = "{{ url }}";
var imageContainer = document.querySelector('.rondell-container');
imageContainer.style.backgroundImage = m_Image;
})();
</script>
{% endif %}
{% endfor %}
I hope this helps.
User | Count |
---|---|
23 | |
19 | |
18 | |
17 | |
16 |