Guest User

Untitled

a guest
Mar 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.86 KB | None | 0 0
  1. <div class="desktop-2 tablet-6 mobile-3" id="aside">
  2. <div id="sidebar">
  3.  
  4.  
  5.  
  6.  
  7.  
  8. <div class="desc-accordion">
  9.  
  10. <ul class="active_tags" id="inject_position">
  11. </ul>
  12.  
  13. {% comment %} sorting {% endcomment %}
  14.  
  15. {% if section.settings.sort_by %}
  16. <div class="extend has_sub_menu" aria-haspopup="true" aria-expanded="false"><h3>{{ 'collections.sorting.title' | t }}</h3></div>
  17.  
  18. <div class="extended-submenu-prod" style="display:none">
  19. <div class="rte inner_prod_desc">
  20. <select id="sort-by" class="styled-select">
  21. <option value="manual">{{ 'collections.sorting.featured' | t }}</option>
  22. <option value="price-ascending">{{ 'collections.sorting.price_ascending' | t }}</option>
  23. <option value="price-descending">{{ 'collections.sorting.price_descending' | t }}</option>
  24. <option value="title-ascending">{{ 'collections.sorting.az' | t }}</option>
  25. <option value="title-descending">{{ 'collections.sorting.za' | t }}</option>
  26. <option value="created-ascending">{{ 'collections.sorting.date_ascending' | t }}</option>
  27. <option value="created-descending">{{ 'collections.sorting.date_descending' | t }}</option>
  28. <option value="best-selling">{{ 'collections.sorting.best_selling' | t }}</option>
  29. </select>
  30. </div>
  31. </div>
  32. {% endif %}
  33.  
  34.  
  35.  
  36.  
  37.  
  38. {% comment %} filters by price {% endcomment %}
  39. {% assign tags = section.settings.tags_1 | split: ',' %}
  40. {% assign show-filter = false %}
  41. {% for tag in tags %}
  42. {% if collection.all_tags contains tag %}
  43. {% assign show-filter = true %}
  44. {% endif %}
  45. {% endfor %}
  46.  
  47.  
  48.  
  49. {% if show-filter %}
  50. <div class="extend has_sub_menu" aria-haspopup="true" aria-expanded="false"><h3 class="bord_btm">Filter by Size</h3></div>
  51.  
  52. <div class="extended-submenu-prod" style="display:none">
  53. <ul class="subnav clearfix listitems autosort">
  54. {% for tag in tags %}
  55. {% if current_tags contains tag %}
  56. <li class="active" data-position="{{ tag }}">{{ tag | link_to_remove_tag: tag }}</li>
  57. {% elsif collection.all_tags contains tag %}
  58. <li data-position="{{ tag }}">{{ tag | link_to_add_tag: tag }}</li>
  59. {% endif %}
  60. {% endfor %}
  61. </ul>
  62. </div>
  63. {% endif %}
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72. {% comment %} filters by price {% endcomment %}
  73.  
  74.  
  75. {% assign tags = section.settings.tags_2 | split: ',' %}
  76. {% assign show-filter = false %}
  77. {% for tag in tags %}
  78. {% if collection.all_tags contains tag %}
  79. {% assign show-filter = true %}
  80. {% endif %}
  81. {% endfor %}
  82. {% if show-filter %}
  83. <div class="extend has_sub_menu" aria-haspopup="true" aria-expanded="false"><h3 class="bord_btm">Filter by Price</h3></div>
  84. <div class="extended-submenu-prod" style="display:none">
  85. <ul class="subnav clearfix listitems autosort">
  86. {% for tag in tags %}
  87. {% if current_tags contains tag %}
  88. <li class="active" data-position="{{ tag | remove: "£" | truncate: 4, "" }}">{{ tag | link_to_remove_tag: tag }}</li>
  89. {% elsif collection.all_tags contains tag %}
  90. <li data-position="{{ tag | remove: "£" | truncate: 4, "" }}">{{ tag | link_to_add_tag: tag }}</li>
  91. {% endif %}
  92. {% endfor %}
  93. </ul>
  94. </div>
  95. {% endif %}
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104. {% comment %}
  105. {% comment %} filters by type {% endcomment %}
  106.  
  107. {% assign tags = section.settings.tags_3 | split: ',' %}
  108. {% assign show-filter = false %}
  109. {% for tag in tags %}
  110. {% if collection.all_tags contains tag %}
  111. {% assign show-filter = true %}
  112. {% endif %}
  113. {% endfor %}
  114. {% if show-filter %}
  115. <div class="extend has_sub_menu" aria-haspopup="true" aria-expanded="false"><h3 class="bord_btm">Filter by Type</h3></div>
  116. <div class="extended-submenu-prod" style="display:none">
  117. <ul class="subnav clearfix listitems autosort">
  118. {% for tag in tags %}
  119. {% if current_tags contains tag %}
  120. <li class="active" data-position="{{ tag }}">{{ tag | link_to_remove_tag: tag }}</li>
  121. {% elsif collection.all_tags contains tag %}
  122. <li data-position="{{ tag }}">{{ tag | link_to_add_tag: tag }}</li>
  123. {% endif %}
  124. {% endfor %}
  125. </ul>
  126. </div>
  127. {% endif %}
  128. {% endcomment %}
  129.  
  130.  
  131.  
  132.  
  133.  
  134. {% comment %} filters by style {% endcomment %}
  135. {% assign tags = section.settings.tags_4 | split: ',' %}
  136. {% assign show-filter = false %}
  137. {% for tag in tags %}
  138. {% if collection.all_tags contains tag %}
  139. {% assign show-filter = true %}
  140. {% endif %}
  141. {% endfor %}
  142.  
  143. {% if show-filter %}
  144. <div class="extend has_sub_menu" aria-haspopup="true" aria-expanded="false"><h3 class="bord_btm">Filter by Style</h3></div>
  145. <div class="extended-submenu-prod" style="display:none">
  146. <ul class="subnav clearfix listitems autosort">
  147. {% for tag in tags %}
  148. {% if current_tags contains tag %}
  149. <li class="active" data-position="{{ tag }}">{{ tag | link_to_remove_tag: tag }}</li>
  150. {% elsif collection.all_tags contains tag %}
  151. <li data-position="{{ tag }}">{{ tag | link_to_add_tag: tag }}</li>
  152. {% endif %}
  153. {% endfor %}
  154. </ul>
  155. </div>
  156. {% endif %}
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163. </div>
  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. {% comment %} for testing
  194. <h2>Current tags</h2>
  195. {% for tag in collection.all_tags %}
  196. {% if current_tags contains tag %}
  197. <li class="active">{{ tag | link_to_remove_tag: tag }}</li>
  198. {% else %}
  199. <li>{{ tag | link_to_add_tag: tag }}</li>
  200. {% endif %}
  201. {% endfor %}
  202.  
  203. {% endcomment %}
  204.  
  205.  
  206. {% comment %}
  207. Include block settings for collection template to add sidebar menus
  208. {% endcomment %}
  209.  
  210. {% for block in section.blocks %}
  211. {% if block.type == 'vendor_list' %}
  212. {% if collection.handle == "all" %}
  213. <ul>
  214. <h2>{{ 'collections.general.shop_by_designer' | t }}</h2>
  215. {% for product_vendor in shop.vendors %}
  216. <li>{{ product_vendor | link_to_vendor }}</li>
  217. {% endfor %}
  218. </ul>
  219. {% else %}
  220. <ul>
  221. <h2>{{ 'collections.general.shop_by_designer' | t }}</h2>
  222. {% for product_vendor in collection.all_vendors %}
  223. <li class="{{ product_vendor | handelize }}">{{ product_vendor | link_to_vendor }}</li>
  224. {% endfor %}
  225. </ul>
  226. {% endif %}
  227. {% else %}
  228.  
  229. <ul class="sidebar-accordion" {{ block.shopify_attributes }}>
  230. <h2>{{ block.settings.title }}</h2>
  231. {% for link in linklists[block.settings.side_nav].links %}
  232. {% if link.links != blank %}
  233. <li class="extend has_sub_menu" aria-haspopup="true" aria-expanded="false">{{ link.title }}</li>
  234. <ul class="extended-submenu">
  235. {% for sub_link in link.links %}
  236. <li><a href="{{ sub_link.url }}">{{ sub_link.title }}</a></li>
  237. {% endfor %}
  238. </ul>
  239.  
  240. {% else %}
  241. <li>{{ link.title | link_to: link.url }}</li>
  242. {% endif %}
  243. {% endfor %}
  244. </ul>
  245.  
  246. {% endif %}
  247.  
  248. {% endfor %}
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258. </div>
  259.  
  260. <script>
  261. Shopify.queryParams = {};
  262. if (location.search.length) {
  263. for (var aKeyValue, i = 0, aCouples = location.search.substr(1).split('&'); i < aCouples.length; i++) {
  264. aKeyValue = aCouples[i].split('=');
  265. if (aKeyValue.length > 1) {
  266. Shopify.queryParams[decodeURIComponent(aKeyValue[0])] = decodeURIComponent(aKeyValue[1]);
  267. }
  268. }
  269. }
  270. jQuery('#sort-by')
  271. .val('{{ collection.sort_by | default: collection.default_sort_by }}')
  272. .bind('change', function() {
  273. Shopify.queryParams.sort_by = jQuery(this).val();
  274. location.search = jQuery.param(Shopify.queryParams);
  275. });
  276.  
  277.  
  278.  
  279.  
  280.  
  281. $(".listitems.autosort").each(function(){
  282. $(this).html($(this).children('li').sort(function(a, b){
  283. return ($(b).data('position')) < ($(a).data('position')) ? 1 : -1;
  284. }));
  285. });
  286.  
  287. $('.desc-accordion').find('.extend').click(function(){
  288. //Expand or collapse this panel
  289. $(this).next().slideToggle('fast');
  290. //Hide the other panels
  291. $(".extended-submenu-prod").not($(this).next()).slideUp('fast');
  292. });
  293.  
  294.  
  295.  
  296. $( ".extended-submenu-prod .active" ).clone().prependTo( "#inject_position" );
  297.  
  298.  
  299. </script>
  300.  
  301.  
  302. {% if section.settings.sticky-sidebar %}
  303. <script>
  304.  
  305. if($(window).width() > 980){
  306.  
  307. $('#sidebar').stickySidebar({
  308.  
  309. sidebarTopMargin: 100,
  310. footerThreshold: 100
  311.  
  312. });
  313. };
  314.  
  315.  
  316.  
  317.  
  318. </script>
  319. {% endif %}
  320.  
  321. </div>
  322.  
  323.  
  324.  
  325.  
  326. <style>
  327. /* Contain floats: nicolasgallagher.com/micro-clearfix-hack/ */
  328. .clearfix:before, .clearfix:after { content: ""; display: table; }
  329. .clearfix:after { clear: both; }
  330. .clearfix { zoom: 1; }
  331. /* Subnavigation styles */
  332. .subnav { clear: both; list-style-type: none; margin: 35px 0; padding: 0; }
  333. .subnav li { display: block; float: left; }
  334. .subnav li a {
  335. display: block;
  336. height: 28px;
  337. line-height: 28px;
  338. padding: 0 7px;
  339. -webkit-border-radius: 7px;
  340. -moz-border-radius: 7px;
  341. border-radius: 7px;
  342.  
  343. margin: 0 7px 7px 0;
  344. color: #383838;
  345. -webkit-transition: color 0.1s ease-in;
  346. -moz-transition: color 0.1s ease-in;
  347. -o-transition: color 0.1s ease-in;
  348. transition: color 0.1s ease-in;
  349. }
  350. .subnav li a:hover, .subnav li.active a {
  351. background: {{ settings.button_color}};
  352. color: #fff;
  353. }
  354.  
  355. .subnav li.active {background:transparent;}
  356. ul.subnav.clearfix.listitems.autosort {
  357. margin-top: 0;
  358. }
  359. </style>
Add Comment
Please, Sign In to add comment