Created
July 13, 2020 14:10
-
-
Save cherrykoda/5eb3a4dab34c05e9f7aaf0d05391e140 to your computer and use it in GitHub Desktop.
[Medium] Macros v. Partials - State Sport Articles
This file contains 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
{% set sportArticles = craft.entries.section('articles').relatedTo(['and', | |
{ element : state }, | |
{ element : sport } | |
]) %} | |
{# Set Popular Articles #} | |
{% do craft.views_work.sortPopular(sportArticles, 'month') %} | |
{% set popularArticles = sportArticles.limit(6).all %} | |
<div class="hero" {% if sport %}style="background: url({{ sport.sportBackground.one.url('sportBg') }}) center center no-repeat; background-size: cover;"{% endif %}> | |
<div class="container"> | |
// Hero Content | |
</div> | |
</div> | |
{% if popularArticles|length %} | |
{% include '_components/_popular-now' with { | |
articles: popularArticles | |
}%} | |
{% endif %} | |
<div class="content"> | |
<div class="container"> | |
// Body Content | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment