-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent-sections-information.php
184 lines (127 loc) · 6.75 KB
/
content-sections-information.php
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!-- ---------------------- Section Template ---------------------- -->
<?php if( get_row_layout() == 'information_section' ): ?>
<div class="row" style="position: relative">
<div class="col-lg-1"></div>
<div class="col-sm-12 col-md-auto information-nav-wrapper" style="position: relative">
<!-- Nav Loops -->
<div class="information-nav">
<div id="information-nav-collapse" role="tablist" aria-multiselectable="false">
<?php if( have_rows('information_category') ): ;?>
<?php while ( have_rows('information_category') ) : the_row(); ;?>
<? $topicId = get_row_index();?>
<?php if( get_row_layout() == 'information_topic' ): ;?>
<div class="card">
<div class="card-header" role="tab" id="information-nav-collapse-heading-<?=$topicId;?>">
<h5 class="mb-0">
<a data-toggle="collapse" class="<?=($topicId==1)?'':'collapsed';?>" data-parent="#information-nav-collapse" href="#information-nav-collapse-item-<?=$topicId;?>" aria-expanded="<?=($topicId==1)?'true':'false';?>" aria-controls="information-nav-collapse-item-<?=$topicId;?>">
<?=get_sub_field('topic_name');?>
</a>
</h5>
</div>
<div id="information-nav-collapse-item-<?=$topicId;?>" class="collapse <?=($topicId==1)?'show':'';?>" role="tabpanel" aria-labelledby="information-nav-collapse-heading-<?=$topicId;?>">
<div class="card-block">
<?php if( have_rows('topic_items') ): ;?>
<ol>
<?php while ( have_rows('topic_items') ) : the_row() ;?>
<? $itemId = get_row_index();?>
<? $itemSlug = str_replace(' ', '-', strtolower(get_sub_field('item_title'))); ?>
<li class="text-uppercase brand-thin"><a href="#<?=$itemSlug;?>"><?=get_sub_field('item_title');?></a></li>
<?php endwhile; ?>
</ol>
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
</div>
</div>
<!-- Nav Loops -->
</div>
<div class="col-sm">
<!-- Content Loops -->
<style>
.information-nav ol {
margin-bottom: 0;
}
.information-nav .card-header h5 a {
position: relative;
display: block;
}
.information-nav .card-header h5 a:after {
position: absolute;
right: 0;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.information-nav .card-header h5 a.collapsed:after {
content: "";
}
.information-nav .card-header h5 a:not(.collapsed):after {
content: "";
}
ol.information-list {
list-style: none;
padding: 0;
margin: 0;
counter-reset: item;
margin-left: 30px;
}
.information-list > li {
position: relative;
counter-increment: item;
margin-bottom: 40px;
margin-left: 40px;
}
.information-list > li > h2 {
text-transform: uppercase;
}
.information-list > li > p {
font-family: "Gotham Thin";
}
.information-list > li > h2:before {
content: counter(item)".";
display: block;
margin-left: -50px;
position: absolute;
}
@media (max-width: 735px) {
.information-nav {
margin-bottom: 30px;
}
}
</style>
<?php if( have_rows('information_category') ): ;?>
<?php while ( have_rows('information_category') ) : the_row(); ;?>
<? $topicId = get_row_index();?>
<? $topicSlug = str_replace(' ', '-', strtolower(get_sub_field('topic_name'))); ?>
<?php if( get_row_layout() == 'information_topic' ): ;?>
<a class="anchor" id="information-topic-<?=$topicId;?>"></a>
<div class="h2 brand-blue brand-medium text-uppercase"><?=get_sub_field('topic_name');?></div>
<hr>
<?php if( have_rows('topic_items') ): ;?>
<ol class="information-list">
<?php while ( have_rows('topic_items') ) : the_row() ;?>
<? $itemId = get_row_index();?>
<? $itemSlug = str_replace(' ', '-', strtolower(get_sub_field('item_title'))); ?>
<li>
<a class="anchor" id="<?=$itemSlug;?>"></a>
<h2><?=get_sub_field('item_title');?></h2>
<p><?=get_sub_field('item_body');?></p>
</li>
<?php endwhile; ?>
</ol>
<?php endif; ?>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
<!-- Content Loops -->
</div>
<div class="col-lg-1"></div>
</div>
<?php endif; ?>
<!-- ---------------------- Section Template ---------------------- -->