Guest User

Untitled

a guest
Jun 22nd, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.42 KB | None | 0 0
  1. {% cache globally using key "navMega" for 1 year %}
  2. <div class="relative hidden lg:block w-full z-50" data-controller="mega-menu">
  3. <div class="sitecontainer">
  4. <nav class="pb-4">
  5. {% for entry in navigation.level(1) %}
  6. {% if loop.first %}
  7. <ul class="list-reset flex justify-between">
  8. <li class="pr-6 // border-r border-white-25">
  9. <a href="{{ siteUrl() }}" class="hover:text-lime {% if craft.request.firstSegment == '' %}text-lime{% else %}text-white{% endif %}" data-action="mouseover->mega-menu#close">
  10. <div class="w-5 // h-5 // fill-current // mr-2">
  11. {% include '_includes/svg/icon-home.svg' %}
  12. <span class="alt">Home</span>
  13. </div>
  14. </a>
  15. </li>
  16. {% endif %}
  17. <li class="pl-4 pr-8 // {% if not loop.last %}border-r border-white-25{% endif %}">
  18. <a href="#" class="text-white hover:text-lime flex items-center font-semibold"
  19. data-action="click->mega-menu#open"
  20. data-next="{{ entry.title|kebab }}">
  21. {{ entry.title }}
  22. {%- if (entry.hasDescendants or entry.type == 'contact' or 'directories') -%}
  23. <div class="ml-1 w-3 h-3 fill-current /// mt-1 flex flex-col justify-center">
  24. {% include '_includes/svg/icon-chevron.svg' %}
  25. </div>
  26. {%- endif -%}
  27. </a>
  28. </li>
  29. {% if loop.last %}</ul>{% endif %}
  30. {% endfor %}
  31.  
  32.  
  33. {% for entry in navigation.level(1) %}
  34. {% switch entry.type %}
  35.  
  36. {% case 'contact' %}
  37. <div id="{{ entry.title|kebab }}" class="mt-10 hidden absolute pin-x bg-petrol p-4 z-10" data-target="mega-menu.menu">
  38. <div class="max-w-4xl flex flex-wrap pt-6 px-8 mx-auto">
  39. <div class="flex flex-col pr-12 mb-12 flex-1">
  40. <h3 class="mb-2 text-lg border-b border-petrol-light pb-2 font-semibold text-grey-lightest mb-6">
  41. {{ entry.title }}
  42. </h3>
  43.  
  44. <div class="flex flex-wrap justify-between">
  45. <div class="w-1/2 pr-12 text-white leading-normal">
  46. <a href="mailto:{{ companyInformation.email }}" class="text-lime hover:text-white text-lg mb-6 inline-block">{{ companyInformation.email }}</a>
  47.  
  48. {% if entry.body|length %}
  49. <div class="article">
  50. {{ entry.body }}
  51. </div>
  52. {% endif %}
  53.  
  54. <p class="text-xs">
  55. ‘{{ siteName }}’ is a trading division of Judd and Judd Ltd, a company registered in England and Wales, registered number 8082403. Registered office: Suite 2, Douglas House, 32-34 Simpson Road, Fenny Stratford, Buckinghamshire, MK1 1BA, United Kingdom.
  56. </p>
  57. </div>
  58.  
  59. <div class="pl-12">
  60. <div class="text-white mb-6">
  61. {% include '_includes/social/follow' %}
  62. </div>
  63.  
  64. {% if entry.relatedContent|length %}
  65. {% for entry in entry.relatedContent %}
  66. {% if loop.first %}<ul class="list-reset">{% endif %}
  67. <li class="text-white mb-2">
  68. <a href="{{ entry.url }}" class="text-white hover:text-lime">{{ entry.title }}</a>
  69. </li>
  70. {% if loop.last %}</ul>{% endif %}
  71. {% endfor %}
  72. {% endif %}
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77.  
  78. {% case "directories" %}
  79. <div id="{{ entry.title|kebab }}" class="mt-10 hidden absolute pin-x bg-petrol p-4 z-10" data-target="mega-menu.menu">
  80. <div class="flex flex-wrap pt-6 px-8 mx-auto">
  81. <div class="flex flex-col pr-12 mb-12 flex-1">
  82. <h3 class="mb-2 text-lg border-b border-petrol-light pb-2 font-semibold text-grey-lightest mb-6">
  83. {{ entry.title }}
  84. </h3>
  85.  
  86. <div class="flex flex-wrap justify-between">
  87. <div class="pr-12 text-white leading-normal">
  88. {% if entry.body|length %}
  89. {{ entry.body }}
  90. {% endif %}
  91.  
  92. {% if entry.relatedContent|length %}
  93. {% for entry in entry.relatedContent %}
  94. {% if loop.first %}<ul class="list-reset">{% endif %}
  95. <li class="text-white mb-2 {% if loop.last %}mt-6 pt-4 border-t border-petrol-light{% endif %}">
  96. <a href="{{ entry.url }}" class="text-white hover:text-lime text-sm">{{ entry.title }}</a>
  97. </li>
  98. {% if loop.last %}</ul>{% endif %}
  99. {% endfor %}
  100. {% endif %}
  101. </div>
  102.  
  103. <div class="pl-6 flex-1 flex flex-wrap">
  104. <h3 class="mb-2 text-lg text-white mb-6 w-full">Latest Updates</h3>
  105. {% for entry in directories %}
  106. {% set logo = entry.logo[0] ?? null %}
  107. <article class="flex /// w-1/2 px-6 mb-6">
  108. <div class="flex items-center justify-center w-32 bg-white p-2">
  109. {% if logo|length %}
  110. <a href="{{ entry.url }}">
  111. <div class="text-center">
  112. {% include '_includes/partials/logo' with { classes: 'p-2 bg-white w-full' } %}
  113. </div>
  114. </a>
  115. {% else %}
  116. {% include '_includes/directories/articleImage' %}
  117. {% endif %}
  118. </div>
  119. <div class="pl-4 /// flex-1 flex flex-col justify-center">
  120. <h3 class="mb-2"><a href="{{ entry.url }}" class="text-lime hover:text-blue text-lg font-semibold">{{ entry.title }}</a></h3>
  121. <p class="text-sm mb-0 text-petrol-light">{{ entry.section }}</p>
  122. </div>
  123. </article>
  124. {% endfor %}
  125. </div>
  126. </div>
  127. </div>
  128. </div>
  129. </div>
  130.  
  131. {% default %}
  132. <div id="{{ entry.title|kebab }}" class="mt-10 hidden absolute pin-x bg-petrol p-4 z-10" data-target="mega-menu.menu">
  133. <div class="flex flex-wrap pt-6 px-8 mx-auto">
  134. {% for entry in entry.children %}
  135. <div class="flex flex-col pr-12 mb-12 flex-1">
  136. <h3 class="mb-2 text-lg border-b border-petrol-light pb-2 font-semibold text-grey-lightest mb-6">
  137. {{ entry.title }}
  138. </h3>
  139. <ul class="list-reset">
  140. {% nav entry in entry.children %}
  141. <li class="mb-2">
  142. {%- switch entry.type.handle -%}
  143. {% case "externalLink" %}
  144. <a href="{{ entry.website }}" target="blank" class="text-sm text-white hover:text-lime">{{ entry.title }}</a></li>
  145. {% case "page" %}
  146. {%- if entry.singleEntry.first|length -%}
  147. <a href="{{ entry.singleEntry.first.url() }}" class="text-sm text-white hover:text-lime">{{ entry.title }}</a></li>
  148. {%- endif -%}
  149. {% default %}
  150. {{ entry.title }}
  151. {%- endswitch -%}
  152.  
  153. {% ifchildren %}
  154. <ul class="ml-4">
  155. {% children %}
  156. </ul>
  157. {% endifchildren %}
  158. </li>
  159. {% endnav %}
  160. </ul>
  161. </div>
  162. {% endfor %}
  163. </div>
  164. </div>
  165. {% endswitch %}
  166. {% endfor %}
  167. </nav>
  168. </div>
  169. </div>
  170. {% endcache %}
Add Comment
Please, Sign In to add comment