-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathcollection-template.liquid
191 lines (158 loc) · 5.61 KB
/
collection-template.liquid
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
{% paginate collection.products by 12 %}
{% assign productCount = collection.all_products_count | minus: paginate.current_offset %}
<div class="{%if section.settings.is_full_width %} container-fluid {%else%} container {%endif%} vh-100">
<header role="banner"
class="d-flex align-items-center"
style="min-height: {{section.settings.header_height}}px;">
<div class="w-100">
<h1 class="text-{{section.settings.header_align}}">{{ collection.title }}</h1>
{% if collection.description != blank %}
<div class="text-{{section.settings.header_align}} ">
{{ collection.description }}
</div>
{% endif %}
</div>
</header>
<div class="row">
<div class="col-md-3">
{% if section.settings.collection_nav %}
{% assign sidebarNav = section.settings.collection_nav %}
<div class="card mb-4">
<div class="card-header">
<strong>{{ linklists[sidebarNav].title }}</strong>
</div>
<ul class="list-group list-group-flush">
{% for link in linklists[sidebarNav].links %}
<li class="list-group-item">
<a href="{{ link.url }}">{{ link.title }}</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if collection.all_tags.size > 0 and section.settings.hide_tags != true %}
<div class="card mb-4">
<div class="card-header">
<strong>Tags</strong>
</div>
<ul class="list-group list-group-flush">
{% for tag in collection.all_tags %}
{% if current_tags contains tag %}
<li class="list-group-item bg-primary">
{{ tag | link_to_remove_tag: tag }}
</li>
{% else %}
<li class="list-group-item">
{{ tag | link_to_tag: tag }}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
{% endif %}
</div>
<div class="col-md-9">
<div class="row">
{% for product in collection.products %}
<div class="col-md-4">
<div class="product-item">
{% if product.featured_image != blank %}
<a href="{{ product.url | within: collection }}">
<img src={{ product.featured_image | img_url:'300x'}} data-src="{{ product.featured_image | img_url:'500x500', crop:'center' }}"
alt="" class="img-fluid lazyload">
</a>
{% endif %}
<p>
<a href="{{ product.url | within: collection }}">{{ product.title }}</a>
</p>
{% include 'product-price' %}
</div>
</div>
{% endfor %}
{% if productCount == 0 %}
<div class="col-md-4">
<h4 class="text-center">
No products
</h4>
</div>
{% endif %}
</div>
{% if paginate.pages > 1 %}
{% include 'pagination' %}
{% endif %}
</div>
</div>
</div>
{% endpaginate %}
{% schema %}
{
"name": "Collection",
"settings": [
{
"type": "header",
"content": "Collection header"
},
{
"type": "checkbox",
"id": "is_full_width",
"label": "Full width",
"default": false
},
{
"type": "select",
"id": "header_align",
"options": [
{
"value": "right",
"label": "Text right"
},
{
"value": "center",
"label": "Text center"
},
{
"value": "left",
"label": "Text left"
}
],
"label": "Header alignment",
"default": "left"
},
{
"type": "range",
"id": "header_height",
"min": 50,
"max": 500,
"step": 5,
"unit": "px",
"label": "Header height",
"default": 120
},
{
"type": "header",
"content": "Sidebar"
},
{
"type": "link_list",
"id": "collection_nav",
"label": "Navigation",
"info": "Select custom menu nav for sidebar"
},
{
"type": "checkbox",
"id": "hide_tags",
"label": "Hide tags",
"default": false,
"info": "Hide tags from sidebar"
},
{
"type": "header",
"content": "Others"
},
{
"type": "paragraph",
"content": "You can add more settings here :) "
}
]
}
{% endschema %}