-
Notifications
You must be signed in to change notification settings - Fork 1
/
entry.twig
153 lines (96 loc) · 5.46 KB
/
entry.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
{% include '_header.twig' %}
<body class="single single-post postid-1 single-format-standard">
<div id="parallax-bg"></div>
<div id="page" class="hfeed site">
{% include '_topbar.twig' %}
<div id="content" class="site-content row">
<div class="container col-md-12">
<div id="primary" class="content-area col-md-8">
<main id="main" class="site-main" role="main">
<article id="post-1" class="post-1 post type-post status-publish format-standard has-post-thumbnail hentry category-uncategorized">
<header class="entry-header">
<h1 class="entry-title">{{ record.title }}</h1>
{% if record.subtitle %}
<h3>{{ record.subtitle }}</h3>
{% endif %}
<div class="entry-meta"><span class="posted-on"><i class="icon-time"> </i> <a href="{{ record.url }}" rel="bookmark"><time class="entry-date published" datetime="{{ record.datepublish }}" title="{{ record.datepublish }}">{{ record.datepublish|localdate("%A %B %e") }}</time><time class="updated" datetime="2013-10-17T21:57:40+00:00">October 17, 2013</time></a></span> <span class="byline"> <i class="icon-user"> </i> <span class="author vcard">{{ record.user.displayname }}</span></span> </div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-content">
<div class="featured-image-single">
</div>
{% 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) == "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 %}
</div><!-- .entry-content -->
<footer class="entry-meta">
</footer><!-- .entry-meta -->
</div>
{% include '_aside.twig' %}
</div>
<!-- End Main Content and Sidebar -->
{% include '_footer.twig' %}
</article><!-- #post-## -->
<!-- End Main Content -->
</div>