-
Notifications
You must be signed in to change notification settings - Fork 3
/
categories.html
207 lines (204 loc) · 11.5 KB
/
categories.html
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
---
layout: category_list
title: Explore Categories
add_to_menu: false
description: "all categories of the help center"
---
<div class="topics-area bg-color1">
<div class="topics-wrapper section-spacing bminus-30">
<div class="container">
<div class="col">
<!--ELENCO DI TUTTE LE CATEGORIE-->
{% assign article_number_tot = 0 %}
{% assign article_number = 0 %}
{% assign sections = 0 %}
{% assign all_categories = site.data.category.category | where: 'draft' ,'false' %}
{% for category in site.data.category.category %}
{% capture category_name %}{{ category.key}}{% endcapture %}
{% capture category_label %}{{ category.label}}{% endcapture %}
{% capture category_draft %}{{ category.draft}}{% endcapture %}
{% capture category_type %}{{ category.type}}{% endcapture %}
{% if category_draft == "false" and category_type == '(categoria)' and category.size > 0 %}
{% assign display_mode = site.data.topicsarea.display_mode %}
<!--CONTATORE POST DELLA CATEGORIA-->
{% assign article_number = 0 %}
{% assign all_posts_of_category = site.categories[category_name] | where: 'category_key', nil | where:
'draft' ,'false' %}
{% if display_mode == "article_in_category" %}
{% if all_posts_of_category.size > 0 %}
{% assign all_posts_of_category_ord = site.categories[category_name] | where: 'category_key', nil | where:
'draft' ,'false' | sort: "order" %}
{% for doc_post in all_posts_of_category_ord %}
{% capture post_draft %}{{ doc_post.draft}}{% endcapture %}
{% if post_draft == "false" %}
<!--CONTA POST NELLA CATEGORIA-->
{% assign article_number = article_number | plus: 1 %}
{% endif %}
{% endfor %}
{% assign article_number_tot = article_number_tot | plus: article_number %}
{% endif %}
{% endif %}
{% if display_mode == "all" %}
<!--CICLO SU TUTTI GLI ARTICOLI DELLA CATEGORIA-->
{% if all_posts_of_category.size > 0 %}
{% assign all_posts_of_category_ord = site.categories[category_name] | where: 'category_key', nil | where:
'draft' ,'false' | sort: "order" %}
{% for post in all_posts_of_category_ord %}
<!--CONTA POST NELLA CATEGORIA-->
{% assign article_number = article_number | plus: 1 %}
{% endfor %}
{% assign article_number_tot = article_number_tot | plus: article_number %}
{% endif %}
{% endif %}
<!--PRENDO TUTTE LE SEZIONI SE SONO IN MODALITA' SEZIONI VISIBILI-->
{% if display_mode == "all" or display_mode == "article_in_section" %}
<!--{% assign all_sections = site.data.category.category | where: 'category_key' , category_name | where: 'draft' ,'false' %} -->
{% assign all_sections = site.data.category.category | where: 'category_key' , category_name | where: 'type'
, '(sezione)' | where: 'draft' ,'false' | sort: "order" %}
{% assign sections = all_sections.size %}
<!--CICLO SU TUTTE LE SEZIONI DELLA CATEGORIA-->
{% for section in all_sections %}
<!--PRENDO TUTTE LE SEZIONI-->
{% capture section_key %}{{section.key}}{% endcapture %}
{% assign all_posts = site.categories[section_key] | where: 'draft' ,'false' %}
{% if section.key != category_name %}
<!--STAMPO GLI ARTICOLI DELLA SEZIONE-->
{% assign normal_posts = site.categories[section.key] | where: 'draft' ,'false' %}
{% if normal_posts.size > 0 %}
{% assign normal_posts_ord = site.categories[section.key] | where: 'category_key' , category_name | where:
'draft' ,'false' | sort: "order" %}
{% for doc_post in normal_posts_ord %}
{% capture post_draft %}{{ doc_post.draft}}{% endcapture %}
{% if post_draft == "false" %}
<!--CONTA POST NELLA SEZIONE-->
{% assign article_number = article_number | plus: 1 %}
{% assign article_number_tot = article_number_tot | plus: 1 %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
<!--FINE CONTATORE-->
<div class="row">
<!-- <article class="topics-service bg-color3 wow fadeIn" style="width: 700px;" data-wow-duration="3s"> -->
<article class="topics-service bg-color3" style="width: 700px;">
<header class="topics-title">
<!--DEB1: {{category_name}}-->
<!--CONTROLLO CHE CI SIA ALMENO UN ARTICOLO NELLA CATEGORIA-->
{% assign all_posts = site.categories[category_name] | where: 'draft' ,'false' %}
{% assign my_category_url = "/categories/" | append: category.url %}
{% if article_number > 0 %}
<h3 class="heading-3 text-capitalize font-weight-bold font-size-title">
<a href="{{ my_category_url | append: '/' | relative_url }}">
{{ category_label }} ({{article_number}})</a>
</h3>
{% else %}
<h3 class="heading-3 text-capitalize">{{ category_label }} ({{article_number}})</h3>
{% endif %}
</header>
<!--{% assign display_mode = site.data.topicsarea.display_mode %}-->
{% assign all_posts_of_category = site.categories[category_name] | where: 'category_key', nil | where:
'draft' ,'false' %}
{% if display_mode == "article_in_category" %}
<ul class="list-inline">
{% if all_posts_of_category.size > 0 %}
{% assign all_posts_of_category_ord = site.categories[category_name] | where: 'category_key', nil |
where: 'draft' ,'false' | sort: "order" %}
{% for doc_post in all_posts_of_category_ord %}
{% capture post_draft %}{{ doc_post.draft}}{% endcapture %}
{% if post_draft == "false" %}
<li><a href="{{ doc_post.url | relative_url }}" class="article_link">{{ doc_post.title }} </a>
</li>
{% endif %}
{% endfor %}
{% endif %}
</ul>
{% endif %}
{% if display_mode == "all" %}
<!--CICLO SU TUTTI GLI ARTICOLI DELLA CATEGORIA-->
{% if all_posts_of_category.size > 0 %}
{% assign all_posts_of_category_ord = site.categories[category_name] | where: 'category_key', nil |
where: 'draft' ,'false' | sort: "order" %}
<ul class="list-inline">
{% for post in all_posts_of_category_ord %}
<li><a href="{{ post.url | relative_url }}" class="article_link">{{ post.title }} </a></li>
{% endfor %}
{% endif %}
</ul>
{% endif %}
<ul class="list-inline">
<!--PRENDO TUTTE LE SEZIONI SE SONO IN MODALITA' SEZIONI VISIBILI-->
{% if display_mode == "all" or display_mode == "article_in_section" %}
{% assign all_sections = site.data.category.category | where: 'category_key' , category_name |
where: 'type' , '(sezione)' | where: 'draft' ,'false' | sort: "order" %}
{% assign sections = all_sections.size %}
<!--CICLO SU TUTTE LE SEZIONI DELLA CATEGORIA-->
{% for section in all_sections %}
<!--PRENDO TUTTE LE SEZIONI-->
{% capture section_key %}{{section.key}}{% endcapture %}
{% assign all_posts = site.categories[section_key] | where: 'category_key' , category_name | where:
'draft' ,'false' %}
{% if section.key != category_name %}
<article class="archive__item" itemscope itemtype="https://schema.org/CreativeWork"
style="margin-top: 16px;">
<h4 class="heading-4" itemprop="headline">
<!-- COSTRUISCO URL SEZIONE -->
{% capture section_url %}{{ '/categories/' | append: section.url }}{% endcapture %}
<!--CAPISCO SE LA SEZIONE CONTIENE O MENO ARTICOLI-->
{% if all_posts.size > 0 %}
<!-- <hr> -->
<h4 class="heading-4 text-capitalize font-weight-bold font-size-title2">
<a href="{{ section_url | append: '/' | relative_url }}"
rel="permalink">{{section.label}}</a>
</h4>
<!-- <a href="{{ section_url | append: '/' | relative_url }}"
rel="permalink">{{section.label}}</a> -->
{% else %}
{{section.label}}
{% endif %}
</h4>
<!--STAMPO GLI ARTICOLI DELLA SEZIONE-->
{% assign normal_posts = site.categories[section.key] | where: 'draft' ,'false' %}
{% if normal_posts.size > 0 %}
{% assign normal_posts_ord = site.categories[section.key] | where: 'category_key' ,
category_name | where: 'draft' ,'false' | sort: "order" %}
{% for doc_post in normal_posts_ord %}
{% capture post_draft %}{{ doc_post.draft}}{% endcapture %}
{% if post_draft == "false" %}
<li><a href="{{ doc_post.url | relative_url }}" class="article_link">
<h7 class="heading-7" itemprop="headline"></h7>{{ doc_post.title }}
</a></li>
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
</ul>
</article>
</div>
{% endif %}
{% endfor %}
{% if article_number_tot == 0%}
<div class="nocontent"
style="text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center;">
<img src="../assets/images/no-content-blue.png" width="200px" height="auto">
<p class="center" id="writeoop">
{{site.data.ui-text[site.locale].category_no | default: "Oops! There seems to be no content." }}{{
section.label }}</p>
</div>
<!-- <div class="nocontent">
<h7 class="heading-7">
<p class="center">{{site.data.ui-text[site.locale].category_no | default: "Create an article .."
}}{{section.label}}</p>
</h7>
</div> -->
<br>
{% endif %}
</div>
</div>
</div>
</div>
</section>
<!-- End Topics Area -->