Commit 942e4971 authored by ancoats's avatar ancoats
Browse files

Style archive filters grid

parent a7804242
......@@ -10,6 +10,18 @@
{% set limitedEntries = clone(queryEntries).offset(entriesPerPage).limit(entriesPerPage) %}
{% paginate limitedEntries as pageData, pageEntries %}
{% set queryFilterCategories = craft.categories()
.group('categoriesEvents')
.relatedTo(queryEntries)
.orderBy('title asc')
.all() %}
{% set queryFilterUsers = craft.users()
.group(['pseudonyms', 'collectives', 'localGroups'])
.relatedTo(queryEntries)
.orderBy('userNamePublic asc')
.all() %}
{% block content %}
{% include '_partials/components/default/page-header.twig' %}
{% embed '_partials/components/default/entries-grid.twig' with {
......@@ -21,22 +33,22 @@
{% endfor %}
{% endblock %}
{% endembed %}
{% include '_partials/components/template-archive/filter-categories.twig' with {
heading: 'Filter events by category'|t,
categories: craft.categories()
.group('categoriesEvents')
.relatedTo(queryEntries)
.orderBy('title asc')
.all()
} %}
{% include '_partials/components/template-archive-events/filter-users.twig' with {
heading: 'Filter events by group'|t,
users: craft.users()
.group(['pseudonyms', 'collectives', 'localGroups'])
.relatedTo(queryEntries)
.orderBy('userNamePublic asc')
.all()
} %}
{% if (queryFilterCategories|length or queryFilterUsers|length) %}
<div class="c-panel u-padding-top-0">
<div class="container">
<div class="c-meta-grid c-meta-grid--filters">
{% include '_partials/components/template-archive/filter-categories.twig' with {
heading: 'Filter events by category'|t,
categories: queryFilterCategories
} %}
{% include '_partials/components/template-archive-events/filter-users.twig' with {
heading: 'Filter events by group'|t,
users: queryFilterUsers
} %}
</div>
</div>
</div>
{% endif %}
{% embed '_partials/components/default/entries-list.twig' with {
class: 'u-background-color-blue-lazuli u-color-white',
heading: 'More upcoming events'|t,
......
......@@ -7,6 +7,12 @@
{% set limitedEntries = clone(queryEntries).offset(entriesPerPage).limit(entriesPerPage) %}
{% paginate limitedEntries as pageData, pageEntries %}
{% set queryFilterCategories = craft.categories()
.group('categoriesNews')
.relatedTo(queryEntries)
.orderBy('title asc')
.all() %}
{% block content %}
{% include '_partials/components/default/page-header.twig' %}
{% if isPageFirst %}
......@@ -14,13 +20,18 @@
displayMode: 'grid',
entries: queryEntries.limit(entriesPerPage).all()
} %}
{% include '_partials/components/template-archive/filter-categories.twig' with {
heading: 'Filter news by category'|t,
categories: craft.categories()
.group('categoriesNews')
.relatedTo(queryEntries)
.all()
} %}
{% if queryFilterCategories|length %}
<div class="c-panel u-padding-top-0">
<div class="container">
<div class="c-meta-grid c-meta-grid--filters">
{% include '_partials/components/template-archive/filter-categories.twig' with {
heading: 'Filter news by category'|t,
categories: queryFilterCategories
} %}
</div>
</div>
</div>
{% endif %}
{% endif %}
{% embed '_partials/components/default/entries-list.twig' with {
class: (isPageFirst ? 'u-background-color-blue-lazuli u-color-white'),
......
......@@ -13,6 +13,12 @@
{% set limitedEntries = clone(queryEntries).offset(entriesPerPage).limit(entriesPerPage) %}
{% paginate limitedEntries as pageData, pageEntries %}
{% set queryFilterCategories = craft.categories()
.group('categoriesPosts')
.relatedTo([queryFeaturedEntry, queryEntries])
.orderBy('title asc')
.all() %}
{% block content %}
{% include '_partials/components/default/page-header.twig' %}
{% if isPageFirst %}
......@@ -28,13 +34,18 @@
{% endfor %}
{% endblock %}
{% endembed %}
{% include '_partials/components/template-archive/filter-categories.twig' with {
heading: 'Filter posts by category'|t,
categories: craft.categories()
.group('categoriesPosts')
.relatedTo([queryFeaturedEntry, queryEntries])
.all()
} %}
{% if queryFilterCategories|length %}
<div class="c-panel u-padding-top-0">
<div class="container">
<div class="c-meta-grid c-meta-grid--filters">
{% include '_partials/components/template-archive/filter-categories.twig' with {
heading: 'Filter news by category'|t,
categories: queryFilterCategories
} %}
</div>
</div>
</div>
{% endif %}
{% endif %}
{% embed '_partials/components/default/entries-list.twig' with {
class: (isPageFirst ? 'u-background-color-blue-lazuli u-color-white'),
......
{% if users|length %}
<section class="c-panel u-padding-top-0" id="filter-group">
<div class="container">
<div class="c-meta-item">
{% if (heading is defined and heading) %}
<span class="c-meta-item__heading">{{ heading }}</span>
{% endif %}
{% include '_partials/components/template-archive-events/list-users.twig' with {
users: users
} %}
</div>
</div>
</section>
<div class="c-meta-item">
{% if (heading is defined and heading) %}
<span class="c-meta-item__heading">{{ heading }}</span>
{% endif %}
{% include '_partials/components/template-archive-events/list-users.twig' with {
users: users
} %}
</div>
{% endif %}
{% if categories|length %}
<section class="c-panel u-padding-top-0" id="filter-categories">
<div class="container">
<div class="c-meta-item">
{% if (heading is defined and heading) %}
<span class="c-meta-item__heading">{{ heading }}</span>
{% endif %}
{% include '_partials/components/shared/list-categories.twig' with {
categories: categories
} %}
</div>
</div>
</section>
<div class="c-meta-item">
{% if (heading is defined and heading) %}
<span class="c-meta-item__heading">{{ heading }}</span>
{% endif %}
{% include '_partials/components/shared/list-categories.twig' with {
categories: categories
} %}
</div>
{% endif %}
This diff is collapsed.
This diff is collapsed.
source @ fccb5a55
Subproject commit 6cd26c955f48730f21bd4bf34f65fb886cc1ee57
Subproject commit fccb5a5535c573ba9baeedd5e10473903e37396c
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment