Snippets

Team Headjam Creative BC Liquid Snippets

Updated by James Nowland

File Schema - Restaurant Added

  • Ignore whitespace
  • Hide word diff
+<script type="application/ld+json">
+{
+  "@context": "http://schema.org",
+  "@type": "Restaurant",
+  "address": {
+    "@type": "PostalAddress",
+    "addressLocality": "{{ gv_site.locations[0]['suburb'] }}",
+    "addressRegion": "{{ gv_site.locations[0]['state'] }}",
+    "postalCode": "{{ gv_site.locations[0]['postcode'] }}",
+    "streetAddress": "{{ gv_site.locations[0]['address1'] }}"
+  },
+  "url": "{{ gv_site.domain }}",
+  "name": "{{ gv_site.name }}",
+  "image": "http://www.blacksheepdarby.com/theme/dist/img/branding/black-logo.png",
+  "description": "We are a café and bar in the heart of Newcastle’s bustling Darby St. Our approach is simple, fresh, edgy, and redefines your traditional café menu.",
+  "telephone": "{{ gv_site.locations[0]['phone'] | replace: ' ','' | replace: '(', '' | replace: ')', '' }}",
+  "priceRange": "$$",
+  "servesCuisine": [
+    "Breakfast",
+    "Lunch",
+    "Dinner",
+    "Coffee"
+  ],
+  "menu": "http://www.blacksheepdarby.com/#our-menu",
+  "sameAs" : [
+  {% for menuSocial in gv_site.social -%}
+    "{{ menuSocial[1] }}"{% unless forloop.last -%},{% endunless %}
+  {% endfor -%}
+  ]
+}
+</script>
Updated by James Nowland

File remove images from html tag Added

  • Ignore whitespace
  • Hide word diff
+<!-- note this requires testing. Author: Adam Cook. -->
+{% assign imgSplits = description | split: '<img ' %}
+{% for imgSplit in imgSplits %}
+	{% comment -%}Each item in the array starts with the middle portion of an img element. We can tell where an img element ends because it will have a closing > character.{% endcomment -%}
+	{% assign img = '<img ' | append: imgSplit | split: '>' | first | append: '>' -%}
+	{% assign description = description | remove: img -%}
+{% endfor %}
Updated by James Nowland

File Edit only on webapp item page Added

  • Ignore whitespace
  • Hide word diff
+{% if globals.cookie.UN contains '@headjam.com.au' && this.['moduleName'] == "webappitem" -%}
+  <script>
+    /*<![CDATA[*/
+    var editLink = $('<a>').attr({
+                            'href'  : '/Admin/CustomContent_Details.aspx?ValueID={{ this.['itemId'] }}',
+                            'target': '_blank'
+                           })
+                           .text('Edit: {{ this.['url'] | split: "/" | first | capitalize }}')
+                           .css({'position': 'fixed', 'bottom': 0, 'right': 0, 'padding': '10px', 'backgroundColor': '#ff9800' })
+
+    $('body').append( editLink );
+    /*]]>*/
+  </script>
+{% endif -%}
Updated by James Nowland

File Schema Organisation - ld+json Added

  • Ignore whitespace
  • Hide word diff
+<script type="application/ld+json">
+  {
+    "@context" : "http://schema.org",
+    "@type" : "Organization",
+    "name" : "{{ gv_site.name }}",
+    "url" : "{{ gv_site.domain }}",
+    "sameAs" : [
+    {% for menuSocial in gv_site.social -%}
+      "{{ menuSocial[1] }}"{% unless forloop.last -%},{% endunless %}
+    {% endfor -%}
+    ]
+  }
+</script>
Updated by James Nowland

File forms - custom captcha field Added

  • Ignore whitespace
  • Hide word diff
+{% capture footerCardSignUpCapture -%}{module_captchav2 backgroundColor="#23135e" foregroundColor="#00e2ff" width="200" height="41" }{% endcapture -%}
+
+{{ footerCardSignUpCapture | replace: 'cat_textbox' , 'ControlInput ControlInput--text' |  remove: 'style="width:200px"' }}
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.