-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlatest.twig
42 lines (41 loc) · 1.34 KB
/
latest.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{% extends 'record.twig' %}
{% block othercontent %}
{% for ct in config.get('contenttypes')if ((not ct.viewless) and (not ct.hide_in_listings)) | default(false) %}
{% setcontent records = ct.slug ~ "/latest/3" %}
<div class="latest">
<h4>
{{ __('contenttypes.generic.recent', {'%contenttypes%': ct.name}) }}
</h4>
<ul class="latest-posts">
{% for record in records %}
<li>
<h5>
<a href="{{ record.link }}">
{{ record.title }}
</a>
</h5>
<small>
{{ record.datepublish|localedatetime("%d.%m.%Y") }}
{% if record.use_password_protection %}
<i class="fa fa-lock"></i>
{% endif %}
</small>
</li>
{% else %}
<li>
{{ __('contenttypes.generic.no-recent', {'%contenttype%': ct.slug}) }}
</li>
{% endfor %}
{# link to contenttype-overview, to see all of its records #}
<li>
<h5>
<a href="{{ path('contentlisting', {'contenttypeslug': ct.slug}) }}">
{{ __('contenttypes.generic.overview',{'%contenttypes%': ct.name}) }}
<small>»</small>
</a>
</h5>
</li>
</ul>
</div>
{% endfor %}
{% endblock othercontent %}