Skip to content

Instantly share code, notes, and snippets.

@natikgadzhi
Created October 3, 2012 13:29
Show Gist options
  • Save natikgadzhi/3826907 to your computer and use it in GitHub Desktop.
Save natikgadzhi/3826907 to your computer and use it in GitHub Desktop.
Videos for one artist in liquor 1 for ikon
//
// Все видео этого артиста
{% assign videos = artist.videos %}
//
// Все каналы с сайта вообще. К сожалению, нет способа забрать все
// каналы этого артиста, поэтому берем все и будем фильтровать.
{% assign channels = site.channels %}
<h2 class="h2">видео<b class="video-menu">
{% for channel in channels %}
// фильтруем все каналы, если в хотя бы одно видео находится в данном канале
// — показываем этот канал. Иначе — пропускаем.
//
{% assign show_channel = false %}
{% for video in videos %}
{% if video.channel.id == channel.id %} {% assign show_channel = true %} {%endif%}
{% endfor %}
{% if show_channel == true %}
<a href="slider-{{channel.id}}">{{channel.title}}</a><span>|</span>
{% endif %}
{% endfor %}
</h2>
<div class="video">
{% assign show_channel = false %}
{% for video in videos %}
{% if video.channel.id == channel.id %} {% assign show_channel = true %} {%endif%}
{% endfor %}
{% if show_channel == true %}
<div id="slider-{{channel-id}}">
{% if channel.videos != empty %}
{% for video in channel.videos %}
        <a href="#"><span style="display: none;">{{ video.code }}</span>{{ video | video_thumbnail_image_tag: '94x54'}}</a>
        {% endfor %}
{% endif %}
</div>
{% endif %}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment