{% include '_macros/collection_tile.html' %} {% include '_macros/market_tile.html' %} {% include '_macros/more_button.html' %} {% set source = category or 'all' %} {% set featured_url = url('featured', [source]) %} {% set featured_url = featured_url|urlparams(src='category-featured') %} {% set category_url = url('category', [category]) if category else url('homepage') %} {% set popular_url = category_url|urlparams(src='category-popular') %} {% set new_url = category_url|urlparams(sort='reviewed', src='category-new') %} {% set search_url = url('search')|urlparams(cat=category) if category else url('search') %} {% set search_url = search_url|urlparams(sort=sort) if sort == 'reviewed' else search_url %} {% defer (url=endpoint|urlunparam(['sort']), pluck='operator', id='shelf', as='collection') %} {% if this.length and this[0].apps.length and this[0].image %} {{ collection_tile(this[0], link=true, src='home') }} {% endif %} {% except %} {% end %} {% defer (url=endpoint|urlunparam(['sort']), pluck='collections', as='collection') %} {% if this and this.length and this[0].apps.length and this[0].image %} {# We're interested in the first item only. #} {{ collection_tile(this[0], link=true, src='home') }} {% endif %} {% except %} {% end %} {% defer (url=endpoint|urlunparam(['sort']), pluck='featured', as='collection') %} {% set featured_apps = this.length and this[0].apps %} {% if featured_apps and featured_apps.length %} {% endif %} {% placeholder %} {# Placeholder is empty because this section is often empty, and we already have a placeholder for the Popular/New sections below. #} {% empty %} {% except %} {% end %}