oliverdavies.uk/source/_partials/talk/events.html.twig
Oliver Davies d57b8ccae0 Hide events with empty dates on a specific talk page
TODO: Move into the TalksExtension Twig functions.

GH-160
2019-12-27 09:40:22 +00:00

23 lines
784 B
Twig

{% import 'helpers' as helpers %}
{% if page.events %}
<div>
<h2 class="mb-2">Presented at</h2>
<ul class="markup list-disc ml-5">
{% for event in page.events if not event.date is empty %}
<li>
{% set eventData = site.events[event.event] %}
{% if eventData.url %}
<a href="{{ eventData.url }}">{{ eventData.name }}</a>
{% else %}
{{ eventData.name }}
{% endif %}
{{ helpers.talkEventLocation(eventData, event) }}
<span class="text-gray-800">- {{ event.date|date('jS F Y') }}</span>
</li>
{% endfor %}
</ul>
</div>
{% endif %}