Last active
December 20, 2015 17:39
-
-
Save zakhardage/6170403 to your computer and use it in GitHub Desktop.
This particular snippet is used to display the about-the-maker tabbed content on koromiko.com's product pages.
This file contains hidden or 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
{% for article in blogs.retailers.articles reversed %} | |
{% assign content = article.content | strip_html | split:',' %} | |
{% assign state = content[1] %} | |
{% unless states contains state %} | |
{% assign count = count | plus:1 %} | |
{% assign stores = 0 %} | |
{% capture states %}{{ state }} {{ states }}{% endcapture %} | |
<h3 class="state">{{ state }}</h3> | |
<p> | |
<script> | |
var stores{{ count }} = new Array(); | |
{% for article in blogs.retailers.articles %} | |
{% if article.content contains state %} | |
{% assign sub-content = article.content | strip_html | split:',' %} | |
stores{{ count }}[{{ stores }}] = "{{ sub-content[0] }}, {{ article.title }}<br />"; | |
{% assign stores = stores | plus:1 %} | |
{% endif %} | |
{% endfor %} | |
stores{{ count }}.sort(); | |
for(var i=0;i<{{ stores }};i++) { | |
document.write(stores{{ count }}[i]); | |
} | |
</script> | |
</p> | |
{% endunless %} | |
{% endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment