Last active
August 19, 2020 06:35
-
-
Save wickywills/0ec0b52b30237691af7bc5197b0e4fa3 to your computer and use it in GitHub Desktop.
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
## Working locally | |
https://www.shopify.com/partners/blog/95401862-3-simple-steps-for-setting-up-a-local-shopify-theme-development-environment | |
## Basics | |
### Conditional | |
``` | |
{% if user.name == 'elvis' %} | |
Hey Elvis | |
{% endif %} | |
``` | |
## Collections | |
Loop through products in any collection | |
```liquid | |
{% for product in collections["handle-name"].products %} | |
{{ product.title }} | |
{% endfor %} | |
``` | |
## Repeatable field (using Advanced Custom Fields plugin) | |
``` | |
<h1 class="wmco-image-text__heading">Våra läderkuddar</h1> | |
{% for image in page.metafields.image-text.image %} | |
{% assign image_index = forloop.index %} | |
{% for text in page.metafields.image-text.text %} | |
{% assign text_index = forloop.index %} | |
{% if image_index == text_index %} | |
<div class="wmco-image-text"> | |
<div class="wmco-image-text__image" style="background-image:url('{{image}}');"></div> | |
<div class="wmco-image-text__text"> | |
<div class="wmco-image-text__text-inner">{{text}}</div> | |
</div> | |
</div> | |
{% endif %} | |
{% endfor %} | |
{% endfor %} | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment