Skip to content

Instantly share code, notes, and snippets.

@carolineschnapp
Created February 22, 2012 00:41
Show Gist options
  • Save carolineschnapp/1880220 to your computer and use it in GitHub Desktop.
Save carolineschnapp/1880220 to your computer and use it in GitHub Desktop.
Extra fields for the Customizr
{% assign number_of_picks = settings.pack_quantity %}
{% assign flavors = settings.pack_flavors | strip_newlines | replace: ' ,', ',' | replace: ' , ', ',' | replace: ', ', ',' %}
{% assign flavor_array = flavors | split: ',' %}
<table>
<tr>
<th>Flavors</th>
{% for i in (1..number_of_picks) %}
<th>{{ i }}</th>
{% endfor %}
</tr>
{% for flavor in flavor_array %}
<tr>
<td>{{ flavor }}</td>
{% for i in (1..number_of_picks) %}
<td><input data-label="Pick no {{ i }}" type="radio" name="pick-{{ i }}" value="{{ flavor | escape }}"{% if flavor == flavor_array.first %} checked="checked"{% endif %} /></td>
{% endfor %}
</tr>
{% endfor %}
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment