{# General Category Tempalte ========================= #} {# Import Section Grouping Macro #} {% import '_macros/section-macro.html' as sectionSelect %} {# Extract Template Handle #} {% set templateHandle = sectionSelect.cat(category) %} {# Subtemplate Setup #} {% set _t = { sectionHomeURL: templateHandle, bodyclass: templateHandle ~ ' category ' ~ category|lower, sectiontype: templateHandle, limit: 12, templatename: 'general/category' } %} {% extends '_layout/main-layout.html' %} {% block content %}
{# Cache Entry #} {% cache globally using key category.group().handle ~ category ~ craft.request.path ~ (craft.request.getPageNum ? '/p' ~ craft.request.getPageNum : '') %} {# Include Featured Image #} {% include '_components/featuredImage.html' with { data: category } %}

{{ category }}

{# Build Query #} {% set entries = craft.entries({ section: templateHandle ~ 'Channel', sort: 'postDate', relatedTo: (category is defined ? category : false), limit: _t.limit }) %} {# Initiate the Pagination #} {% paginate entries as pageInfo, pageEntries %} {# Loop through entries #} {% include '_components/articleBoxes.html' with { data: pageEntries, type: templateHandle } %} {# Include Pagination #} {{ _.pagination(pageInfo,craft) }} {% endcache %}
{% endblock %}