Forum Discussion
Using Liquid for image URL
Hey David_M, I think both ways would work, but I would kind of lean towards the assigning image URL at the top of the HTML.
The only reason I lean towards that method would be that housing entire snippets of HTML in content blocks to then reference in the HTML may possibly get messy and harder to maintain over times.
Housing all the images upfront in the body of the HTML means that you can see everything in it's entirety and only requires 1 update (all 13 images upfront) as opposed to changing 13 different content blocks, requiring all of which to be updated each day (just increases chance of error).
You would be able to reference the 13 images by liquid, so like as an example
{% if ${language} == 'en' %}
{% assign language_image = 'english image url' %}
{% elsif ${language} == 'es' %}
{% assign language_image = 'spanish image url' %}
{% else %}
{% assign language_image = 'default image url' %}
{% endif %}
and then reference your image source in the HTML with
<img src="{{language_image}}" alt="" style="display:block;">
those are just my thoughts! 😀