-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathanotherextrafields.twig
executable file
·81 lines (79 loc) · 4.41 KB
/
anotherextrafields.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{% extends '_base.twig' %}
{% block body %}
{# Make sure we have an image to use as background: #}
{% set image = record.image ?: random(theme.images) %}
<div class="headerimage" style="background-image:url({{image(image, 1920, 1080)}})"></div>
<div class="flex container margin padding popUppers">
<article class="eight s-twelve">
{{ widgets('main_top') }}
<h1 data-bolt-field="title">{{ record.title }}</h1>
{% for key,value in record.values if key not in ['id', 'slug', 'datecreated', 'datechanged', 'datepublish', 'datedepublish', 'username', 'status', 'title', 'subtitle', 'ownerid', 'templatefields'] %}
{% if record.fieldtype(key) == "imagelist" and value is not empty %}
{% set list = attribute(record, key) %}
<div class="images">
{% for item in list %}
<div class="imageholder">
{{ popup(item.filename) }}
</div>
{% endfor %}
</div>
{% elseif record.fieldtype(key) == "image" %}
{{ popup(value, 440, 0) }}
{% elseif record.fieldtype(key) == "video" and value.responsive is defined %}
{{ value.responsive }}
{% elseif record.fieldtype(key) == "geolocation" and value.latitude is defined %}
<img src="http://maps.googleapis.com/maps/api/staticmap?center={{ value.latitude }},{{ value.longitude }}&zoom=14&size=617x300&sensor=false&markers={{ value.latitude }},{{ value.longitude }}">
{% elseif record.fieldtype(key) in ['html', 'markdown', 'textarea'] %}
<div data-bolt-field="{{key}}">{{ attribute(record, key) }}</div>
{% elseif record.fieldtype(key) == "select" and value is not empty %}
<p><strong>{{ key }}: </strong>
{{ attribute(record, key)|join(", ") }}
</p>
{% elseif record.fieldtype(key) == "checkbox" %}
<p>Checkbox: {{value ? "checked" : "not checked"}}</p>
{% elseif record.fieldtype(key) not in ['templateselect'] and value != "" and value is not empty %}
<p><strong>{{ key }}: </strong>
{% if attribute(record, key) is iterable %}
{{ dump(attribute(record, key)) }}
{% else %}
{{ attribute(record, key) }}
{% endif %}
</p>
{% endif %}
{% endfor %}
{# Uncomment this if you wish to dump the entire record to the client, for debugging purposes.
{{ dump(record) }}
#}
{% include '_recordfooter.twig' with {'record': record} %}
<p class="meta">
{% set previous = record.previous('id') %}
{% if previous %}
<a href="{{ previous.link }}">« {{ previous.title }}</a>
{% endif %}
-
{% set next = record.next('id') %}
{% if next %}
<a href="{{ next.link }}">{{ next.title }} »</a>
{% endif %}
</p>
{% set relatedrecords = record.related() %}
{% if relatedrecords is not empty %}
<p class="meta">{{ __('Related content:') }}
<ul>
{% for related in relatedrecords %}
<li><a href="{{ related.link }}">{{ related.title }}</a></li>
{% endfor %}
</ul>
</p>
{% endif %}
{{ widgets('main_bottom') }}
</article>
<article class="four m-twelve">
{{ widgets('aside_top') }}
{{ popup(record.templatefields.image, 440, 0) }}
<div>{{ record.templatefields.markdown }}</div>
<img src="http://maps.googleapis.com/maps/api/staticmap?center={{ record.templatefields.geolocation.latitude }},{{ record.templatefields.geolocation.longitude }}&zoom=14&size=617x300&sensor=false&markers={{ record.templatefields.geolocation.latitude }},{{ record.templatefields.geolocation.longitude }}">
{{ widgets('aside_bottom') }}
</article>
</div>
{% endblock %}