Created
September 17, 2018 09:56
-
-
Save ed-codes/909cca42aea08c1d335a90f5ee6d5d76 to your computer and use it in GitHub Desktop.
Show a png image based on product tags with a matching name. e.g. tag a product with 'mens-crew-neck-size-guide' to display a png of the same name.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section class="item" id="tab-2" data-title="Size Guides"> | |
<div class="item-content"> | |
{% for tag in product.tags %} | |
{% if tag contains 'size-guide'%} | |
{% capture tagImage %}{{tag}}.png{% endcapture %} | |
<img class="size-guide" src="{{ tagImage | asset_img_url: '1200x' }}" width="700" alt="{{ tag }}"> | |
{% endif %} | |
{% endfor %} | |
</div> | |
</section> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment