This repository has been archived by the owner on Aug 30, 2018. It is now read-only.
/
theme.liquid
executable file
·438 lines (404 loc) · 19.6 KB
/
theme.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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
<!doctype html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if IE 9 ]><html class="ie9 no-js"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<!-- Basic page needs ================================================== -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
{% if settings.favicon_enable %}
<link rel="shortcut icon" href="{{ 'favicon.png' | asset_url }}" type="image/png" />
{% endif %}
<!-- Title and description ================================================== -->
<title>
{{ page_title }}{% if current_tags %}{% assign meta_tags = current_tags | join: ', ' %} – {{ 'general.meta.tags' | t: tags: meta_tags }}{% endif %}{% if current_page != 1 %} – {{ 'general.meta.page' | t: page: current_page }}{% endif %}{% unless page_title contains shop.name %} – {{ shop.name }}{% endunless %}
</title>
{% if page_description %}
<meta name="description" content="{{ page_description | escape }}">
{% endif %}
<!-- Helpers ================================================== -->
{% include 'social-meta-tags' %}
<link rel="canonical" href="{{ canonical_url }}">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="{{ settings.color_primary }}">
<!-- CSS ================================================== -->
{{ 'timber.scss.css' | asset_url | stylesheet_tag }}
<!-- Header hook for plugins ================================================== -->
{{ content_for_header }}
{% include 'oldIE-js' %}
{{ '//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js' | script_tag }}
{{ 'modernizr.min.js' | asset_url | script_tag }}
{% comment %}
If you store has customer accounts disabled, you can remove the following JS file
{% endcomment %}
{% if template contains 'customers' %}
{{ 'shopify_common.js' | shopify_asset_url | script_tag }}
{% endif %}
</head>
{% comment %}
Add the page template as a class for easy page or template specific styling.
{% endcomment %}
<body id="{{ page_title | handle }}" class="{% if customer %}customer-logged-in {% endif %}template-{{ template | replace: '.', ' ' | truncatewords: 1, '' | handle }}" >
<div id="NavDrawer" class="drawer drawer--left">
<div class="drawer__header">
<div class="drawer__title h3">{{ 'layout.drawers.browse' | t }}</div>
<div class="drawer__close js-drawer-close">
<button type="button" class="icon-fallback-text">
<span class="icon icon-x" aria-hidden="true"></span>
<span class="fallback-text">{{ 'layout.drawers.close_menu' | t }}</span>
</button>
</div>
</div>
<!-- begin mobile-nav -->
<ul class="mobile-nav">
<li class="mobile-nav__item mobile-nav__search">
{% include 'search-bar' %}
</li>
{% for link in linklists.main-menu.links %}
{% comment %}
Create a dropdown menu by naming a linklist the same as a link in the parent nav
More info on dropdowns:
- http://docs.shopify.com/manual/your-website/navigation/create-drop-down-menu
{% endcomment %}
{% assign child_list_handle = link.title | handleize %}
{% if linklists[child_list_handle].links != blank %}
<li class="mobile-nav__item{% if link.active %} mobile-nav__item--active{% endif %}" aria-haspopup="true">
<div class="mobile-nav__has-sublist">
<a href="{{ link.url }}" class="mobile-nav__link">{{ link.title }}</a>
<div class="mobile-nav__toggle">
<button type="button" class="icon-fallback-text mobile-nav__toggle-open">
<span class="icon icon-plus" aria-hidden="true"></span>
<span class="fallback-text">See More</span>
</button>
<button type="button" class="icon-fallback-text mobile-nav__toggle-close">
<span class="icon icon-minus" aria-hidden="true"></span>
<span class="fallback-text">{{ 'cart.general.close_cart' | t | json }}</span>
</button>
</div>
</div>
<ul class="mobile-nav__sublist">
{% for childlink in linklists[child_list_handle].links %}
<li class="mobile-nav__item {% if childlink.active %} mobile-nav__item--active{% endif %}">
<a href="{{ childlink.url }}" class="mobile-nav__link">{{ childlink.title | escape }}</a>
</li>
{% endfor %}
</ul>
</li>
{% else %}
<li class="mobile-nav__item{% if link.active %} mobile-nav__item--active{% endif %}">
<a href="{{ link.url }}" class="mobile-nav__link">{{ link.title }}</a>
</li>
{% endif %}
{% endfor %}
{% comment %}
If customer accounts are enabled, provide login and create account links
{% endcomment %}
{% if shop.customer_accounts_enabled %}
{% if customer %}
<li class="mobile-nav__item">
{% if customer.first_name != blank %}
{% capture first_name %}{{ customer.first_name }}{% endcapture %}
<a href="/account">{{ 'layout.customer.logged_in_as_html' | t: first_name: first_name }}</a>
{% else %}
<a href="/account">{{ 'layout.customer.account' | t }}</a>
{% endif %}
</li>
<li class="mobile-nav__item">
{{ 'layout.customer.log_out' | t | customer_logout_link }}
</li>
{% else %}
<li class="mobile-nav__item">
{{ 'layout.customer.log_in' | t | customer_login_link }}
</li>
<li class="mobile-nav__item">
{{ 'layout.customer.create_account' | t | customer_register_link }}
</li>
{% endif %}
{% endif %}
</ul>
<!-- //mobile-nav -->
</div>
{% if settings.ajax_cart_method == "drawer" %}
<div id="CartDrawer" class="drawer drawer--right">
<div class="drawer__header">
<div class="drawer__title h3">{{ 'cart.general.title' | t }}</div>
<div class="drawer__close js-drawer-close">
<button type="button" class="icon-fallback-text">
<span class="icon icon-x" aria-hidden="true"></span>
<span class="fallback-text">{{ 'cart.general.close_cart' | t | json }}</span>
</button>
</div>
</div>
<div id="CartContainer"></div>
</div>
{% endif %}
<div id="PageContainer" class="is-moved-by-drawer">
<header class="site-header" role="banner">
<div class="wrapper">
<div class="grid--full grid--table">
<div class="grid__item large--one-half">
{% comment %}
Use the uploaded logo from theme settings if enabled.
Site name gets precedence with H1 tag on homepage, div on other pages.
{% endcomment %}
{% if template == 'index' %}
<h1 class="site-header__logo large--left" itemscope itemtype="http://schema.org/Organization">
{% else %}
<div class="h1 site-header__logo large--left" itemscope itemtype="http://schema.org/Organization">
{% endif %}
{% if settings.logo_use_image %}
<a href="/" itemprop="url" class="site-header__logo-link">
<img src="{{ 'logo.png' | asset_url }}" alt="{{ shop.name }}" itemprop="logo">
</a>
{% else %}
<a href="/" itemprop="url">{{ shop.name }}</a>
{% endif %}
{% if template == 'index' %}
</h1>
{% else %}
</div>
{% endif %}
</div>
<div class="grid__item large--one-half large--text-right medium-down--hide">
{% comment %}
Show number of items in the cart and total cost in the /cart link
Ajax Cart Notes:
- #cartCount updates the total number of items in the cart
- #cartCost updates the total cost of the cart
- Documentation: http://shopify.com/timber#ajax-cart
{% endcomment %}
<div>
<a href="/cart" class="site-header__cart-toggle js-drawer-open-right" aria-controls="CartDrawer" aria-expanded="false">
<span class="icon icon-cart" aria-hidden="true"></span>
{{ 'layout.cart.title' | t }}
(<span id="CartCount">{{ cart.item_count }}</span>
{{ 'layout.cart.items_count' | t: count: cart.item_count }}
<span id="CartCost">{{ cart.total_price | money }}</span>)
</a>
</div>
{% comment %}
If customer accounts are enabled, provide login and create account links
{% endcomment %}
{% if shop.customer_accounts_enabled %}
<div>
{% if customer %}
{% if customer.first_name != blank %}
{% capture first_name %}<a href="/account">{{ customer.first_name }}</a>{% endcapture %}
{{ 'layout.customer.logged_in_as_html' | t: first_name: first_name }}
{% else %}
<a href="/account">{{ 'layout.customer.account' | t }}</a>
{% endif %}
| {{ 'layout.customer.log_out' | t | customer_logout_link }}
{% else %}
{{ 'layout.customer.log_in' | t | customer_login_link }}
| {{ 'layout.customer.create_account' | t | customer_register_link }}
{% endif %}
</div>
{% endif %}
<div class="site-header__search">
{% include 'search-bar' %}
</div>
</div>
</div>
</div>
</header>
<nav class="nav-bar" role="navigation">
<div class="wrapper">
<div class="medium-down--hide">
{% comment %}
List out your main-menu linklist (default)
More info on linklists:
- http://docs.shopify.com/themes/liquid-variables/linklists
{% endcomment %}
<!-- begin site-nav -->
<ul class="site-nav" id="AccessibleNav">
{% for link in linklists.main-menu.links %}
{% comment %}
Create a dropdown menu by naming a linklist the same as a link in the parent nav
More info on dropdowns:
- http://docs.shopify.com/manual/your-website/navigation/create-drop-down-menu
{% endcomment %}
{% assign child_list_handle = link.title | handleize %}
{% if linklists[child_list_handle].links != blank %}
<li class="site-nav--has-dropdown{% if link.active %} site-nav--active{% endif %}" aria-haspopup="true">
<a href="{{ link.url }}" class="site-nav__link">
{{ link.title }}
<span class="icon icon-arrow-down" aria-hidden="true"></span>
</a>
<ul class="site-nav__dropdown">
{% for childlink in linklists[child_list_handle].links %}
<li{% if childlink.active %} class="site-nav--active"{% endif %}>
<a href="{{ childlink.url }}" class="site-nav__link">{{ childlink.title | escape }}</a>
</li>
{% endfor %}
</ul>
</li>
{% else %}
<li {% if link.active %}class="site-nav--active"{% endif %}>
<a href="{{ link.url }}" class="site-nav__link">{{ link.title }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
<!-- //site-nav -->
</div>
<div class="large--hide medium-down--show">
<div class="grid">
<div class="grid__item one-half">
<div class="site-nav--mobile">
<button type="button" class="icon-fallback-text site-nav__link js-drawer-open-left" aria-controls="NavDrawer" aria-expanded="false">
<span class="icon icon-hamburger" aria-hidden="true"></span>
<span class="fallback-text">{{ 'layout.navigation.menu' | t }}</span>
</button>
</div>
</div>
<div class="grid__item one-half text-right">
<div class="site-nav--mobile">
<a href="/cart" class="js-drawer-open-right site-nav__link" aria-controls="CartDrawer" aria-expanded="false">
<span class="icon-fallback-text">
<span class="icon icon-cart" aria-hidden="true"></span>
<span class="fallback-text">{{ 'layout.cart.title' | t }}</span>
</span>
</a>
</div>
</div>
</div>
</div>
</div>
</nav>
<main class="wrapper main-content" role="main">
{{ content_for_layout }}
</main>
<!-- begin site-footer -->
<footer class="site-footer small--text-center" role="contentinfo">
<div class="wrapper">
<div class="grid">
{% if settings.footer_social_enable %}
<div class="grid__item large--one-third medium--one-half">
<h3>{{ 'layout.footer.social_title' | t }}</h3>
<ul class="inline-list social-icons">
{% if settings.social_twitter_link != blank %}
<li>
<a class="icon-fallback-text" href="{{ settings.social_twitter_link }}" title="{{ shop.name }} on Twitter">
<span class="icon icon-twitter" aria-hidden="true"></span>
<span class="fallback-text">Twitter</span>
</a>
</li>
{% endif %}
{% if settings.social_facebook_link != blank %}
<li>
<a class="icon-fallback-text" href="{{ settings.social_facebook_link }}" title="{{ shop.name }} on Facebook">
<span class="icon icon-facebook" aria-hidden="true"></span>
<span class="fallback-text">Facebook</span>
</a>
</li>
{% endif %}
</ul>
</div>
{% endif %}
{% if settings.footer_newsletter_enable %}
<div class="grid__item large--one-third push--large--one-third medium--one-half">
{% comment %}
MailChimp is the go-to newsletter service for Shopify.
Use the link below to find your MailChimp form action
and insert it in your site settings.
If the form action URL is not set in the theme settings,
it will fallback to a customer form so you can still capture the email.
MailChimp newsletter integration and requirement:
- http://docs.shopify.com/support/configuration/store-customization/where-do-i-get-my-mailchimp-form-action
{% endcomment %}
<h3>{{ 'layout.footer.newsletter_title' | t }}</h3>
{% if settings.newsletter_form_action != blank %}
<form action="{{ settings.newsletter_form_action }}" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" target="_blank" class="input-group">
<input type="email" value="{% if customer %}{{ customer.email }}{% endif %}" placeholder="{{ 'general.newsletter_form.newsletter_email' | t }}" name="EMAIL" id="mail" class="input-group-field" aria-label="{{ 'general.newsletter_form.newsletter_email' | t }}" autocorrect="off" autocapitalize="off">
<span class="input-group-btn">
<input type="submit" class="btn" name="subscribe" id="subscribe" value="{{ 'general.newsletter_form.submit' | t }}">
</span>
</form>
{% else %}
{% form 'customer' %}
{{ form.errors | default_errors }}
{% if form.posted_successfully? %}
<p class="note form-success">{{ 'general.newsletter_form.confirmation' | t }}</p>
{% else %}
<div class="input-group">
<input type="email" value="{% if customer %}{{ customer.email }}{% endif %}" placeholder="{{ 'general.newsletter_form.newsletter_email' | t }}" name="contact[email]" id="Email" class="input-group-field" aria-label="{{ 'general.newsletter_form.newsletter_email' | t }}" autocorrect="off" autocapitalize="off">
<input type="hidden" name="contact[tags]" value="newsletter">
<span class="input-group-btn">
<input type="submit" class="btn" name="subscribe" id="subscribe" value="{{ 'general.newsletter_form.submit' | t }}">
</span>
</div>
{% endif %}
{% endform %}
{% endif %}
</div>
{% endif %}
<div class="grid__item text-center">
<hr>
{% comment %}
Loop through available payment methods and show their icons.
{% endcomment %}
{% unless shop.enabled_payment_types == empty %}
{% assign payment_icons_available = 'amazon_payments,american_express,bitcoin,cirrus,dankort,diners_club,discover,dogecoin,dwolla,forbrugsforeningen,interac,jcb,laser,litecoin,maestro,master,paypal,solo,stripe,switch,visa' | split: ',' %}
<h4 class="text-center">{{ 'layout.footer.accepted_payments' | t }}</h4>
<ul class="inline-list payment-icons">
{% for type in shop.enabled_payment_types %}
{% if payment_icons_available contains type %}
<li>
<span class="icon-fallback-text">
<span class="icon icon-{{type}}" aria-hidden="true"></span>
<span class="fallback-text">{{ type | replace: '_',' '}}</span>
</span>
</li>
{% endif %}
{% endfor %}
</ul>
{% endunless %}
<a href="http://shopify.com/timber">Timber Theme Framework</a> by <a href="http://www.shopify.com?ref=Timber" title="Shopify.com">Shopify</a><br>
<small>{{ powered_by_link }}</small>
</div>
</div>
</div>
</footer>
<!-- //site-footer -->
</div>
{{ 'fastclick.min.js' | asset_url | script_tag }}
{{ 'timber.js' | asset_url | script_tag }}
{% comment %}
Template-specific js
{% endcomment %}
<script>
{% if resetPassword %}
$(function() {
timber.resetPasswordSuccess();
});
{% endif %}
</script>
{% comment %}
Ajaxify your cart with this plugin.
Documentation:
- http://shopify.com/timber#ajax-cart
{% endcomment %}
{% if settings.ajax_cart_method == "drawer" %}
{{ 'handlebars.min.js' | asset_url | script_tag }}
{% include 'ajax-cart-template' %}
{{ 'ajax-cart.js' | asset_url | script_tag }}
<script>
jQuery(function($) {
ajaxCart.init({
formSelector: '#AddToCartForm',
cartContainer: '#CartContainer',
addToCartSelector: '#AddToCart',
cartCountSelector: '#CartCount',
cartCostSelector: '#CartCost',
moneyFormat: {{ shop.money_format | json }}
});
});
jQuery(document.body).on('afterCartLoad.ajaxCart', function(evt, cart) {
// Bind to 'afterCartLoad.ajaxCart' to run any javascript after the cart has loaded in the DOM
timber.RightDrawer.open();
});
</script>
{% endif %}
</body>
</html>