Bellow, this is an example of Classic Theme slider: https://themes.shopify.com/themes/classic/styles/light
You don't need to assign all of those repeated variables.
Try not to duplicate code. Instead use for loops.
Bellow, this is an example of Classic Theme slider: https://themes.shopify.com/themes/classic/styles/light
You don't need to assign all of those repeated variables.
Try not to duplicate code. Instead use for loops.
| {% if settings.slider_home_enable %} | |
| <div class="flexslider"> | |
| <ul class="slides"> | |
| {% for i in (1..6) %} | |
| {% capture slide %}slide_{{ i }}{% endcapture %} | |
| {% capture slide_link %}slide_{{ i }}_link{% endcapture %} | |
| {% capture slide_img %}slide_{{ i }}.jpg{% endcapture %} | |
| {% capture slide_alt %}slide_{{ i }}_alt{% endcapture %} | |
| {% if settings[slide] %} | |
| <li> | |
| <a href="{{ settings[slide_link] }}" class="slide-link"> | |
| {{ slide_img | asset_url | img_tag: settings[slide_alt] }} | |
| </a> | |
| </li> | |
| {% endif %} | |
| {% endfor %} | |
| </ul> | |
| </div> | |
| {% endif %} |