Skip to content

Instantly share code, notes, and snippets.

@anova
Created October 24, 2014 12:52
Show Gist options
  • Save anova/c29ba55dab906b65bb96 to your computer and use it in GitHub Desktop.
Save anova/c29ba55dab906b65bb96 to your computer and use it in GitHub Desktop.
Show banners if banner group name equal with product slug.
{% get_banners as bannerlar %}
{% for banner in bannerlar %}
{% if banner.group == product.name|slugify %}
{% for banner_resim in banner %}
<li class="{% if forloop.counter|divisibleby:2 %}indexbanner-right{% endif %}">
{{ banner.group }}
<a href="{{ banner_resim.url }}">s
<span><img src="{{ media_url }}{{ banner_resim.picture }}" /></span>
</a>
</li>
{% endfor %}
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment