-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontact.twig
107 lines (78 loc) · 4.28 KB
/
contact.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{% include '_header.twig' %}
<div id="container">
<div class="two-third">
<h1>{{ record.title }}</h1>
{% if record.subtitle %}
<h3>{{ record.subtitle }}</h3>
{% endif %}
{% for key,value in record.values if key not in ['id', 'slug', 'datecreated', 'datechanged', 'datepublish', 'datedepublish', 'username', 'status', 'title', 'subtitle', 'ownerid'] %}
{% if record.fieldtype(key) == "image" and value != "" %}
{% if record.image!="" %}
<div class="large-4 imageholder">
<a href="{{ image(value) }}">
<img src="{{ thumbnail(value, 640, 480) }}">
</a>
</div>
{% endif %}
{% elseif record.fieldtype(key) == "imagelist" and value != "" %}
{# We do something tricky here: we need to get value of the list in the proper
way, so the value in actually returned as a list. Using {{ record.key }}
won't work, because there is no value 'key'. In your own templates you
will be able to use {{ record.yourfieldname }}. #}
{% set list = attribute(record, key) %}
{% for item in list %}
<a href="{{ image(item.filename) }}">
<img src="{{ thumbnail(item.filename, 100,100) }}" alt="{{ item.title }}" title="{{ item.title }}">
</a>
{% endfor %}
{% elseif record.fieldtype(key) == "video" and value.responsive is defined %}
{{ value.responsive }}
{% elseif record.fieldtype(key) == "geolocation" and value.latitude is defined %}
<div class='imageholder-wide'>
<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 }}">
</div>
<p>{{ value.formatted_address }}</p>
{% elseif record.fieldtype(key) in ['html', 'markdown', 'textarea'] %}
{{ attribute(record, key) }}
{% elseif record.fieldtype(key) == "select" %}
{# special case for 'select' fields.. If it's a multiple select, the value is an array. #}
<p><strong>{{ key }}: </strong>
{{ attribute(record, key)|join(", ") }}
</p>
{% elseif record.fieldtype(key) not in ['templateselect'] and value != "" %}
<p><strong>{{ key }}: </strong>
{{ attribute(record, key) }}
</p>
{% endif %}
{% endfor %}
{# Uncomment this if you wish to dump the entire record to the client, for debugging purposes.
{{ print(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 %}
{{ simpleform('contact') }}
</div>
{% include '_aside.twig' %}
<div style="clear:both; height: 40px"></div>
</div><!-- close container -->
{% include '_footer.twig' %}