{# ------------------------------------------------------- #} {# LIST VIEW OF ALL guest #} {# Webhook uses the SWIG.js (like Djagno/Twig) templating system. Their documentation is here: #} {# http://paularmstrong.github.io/swig/docs/tags/ #} {# Learn about calling data into Webhook pages here: #} {# http://www.webhook.com/docs/template-rules-and-filters/ #} {# ------------------------------------------------------- #} {# Confused what extends and blocks do? Watch a primer: #} {# http://www.webhook.com/docs/template-inheritance-blocks/ #} {% extends "templates/partials/base.html" %} {# This sets our page . It will append guest to the site title defined in base.html #} {% block title %}{% parent %} - guest{% endblock %} {% block content %} {% spaceless %} {# The first thing we do is call guest data from the CMS. #} {% set data = cms.guest %} {# Since webhook sorts by name with Upper Casing sensitivity lets resort the .name by using a custom field #} {% for item in data %} {% set item._lowername = item.name.toLowerCase() %} {% endfor %} {% set data = data|sort('_lowername') %} {% endspaceless %} <h1>Guests attending TwitchCon</h1> <p>Meet...our...guests, meet our guests. TwitchCon will have the best. Meet your favs, meet them all, they’ll be roaming the Expo Hall.</p> <p>We proudly present the following stars of Twitch, our ambassadors of TwitchCon!</p> <h2>Featured Broadcasters</h2> {% spaceless %} <ul class="grid grid--xs-1-2 grid--sm-1-5 guest-list"> {% for item in data %} {% if item.tier == 1 %} <li><a href="{{ url(item) }}"> <div class="aspect aspect--square guest-list__img" > {% if item.image_profile %} <img src="{{ item.image_profile|imageCrop(200) }}" /> {% else %} <img src="{{ item.stream.thumbnail_url|replace('600x600', '300x300', 'g') }}" /> {% endif %} </div> {{ item.name }} </a></li> {% endif %} {% endfor %} </ul> {% endspaceless %} <h2>Also Featured</h2> {% spaceless %} <ul class="grid grid--xs-1-3 grid--sm-1-6 guest-list guest-list--sm"> {% for item in data %} {% if item.tier == 2 %} <li><a href="{{ url(item) }}"> <div class="aspect aspect--square guest-list__img" > {% if item.image_profile %} <img src="{{ item.image_profile|imageCrop(200) }}" /> {% else %} <img src="{{ item.stream.thumbnail_url|replace('600x600', '300x300', 'g') }}" /> {% endif %} </div> {{ item.name }} </a></li> {% endif %} {% endfor %} </ul> {% endspaceless %} {# If you want to show Tier 3 guests you can uncomment this. Beware though... tier 3 is not shown on the site much and adding many guests will up the time needed for compiles significantly. Last year there were a few hundred :( We Should consider just making a static list here with no individual links <h2>Other Broadcasters in Attendance</h2> {% spaceless %} <ul class="grid grid--xs-1-3 grid--sm-1-6 guest-list guest-list--sm"> {% for item in data %} {% if item.tier == 3 %} <li><a href="{{ url(item) }}">{{ item.name }}</a></li> {% endif %} {% endfor %} </ul> {% endspaceless %} #} {% endblock %}