Snippets

Team Headjam Creative BC Liquid Snippets

Created by Headjam Creative last modified James Nowland
/Default.aspx?PageID={{ pageID }}&A=WebApp&CCID={{ webApp }}&Page={{ '5' }}&Items=500&json=1
{%comment -%} You can edit the list template from Layouts/CustomerOrders/list.html {%endcomment -%}
{% capture ordersOutput -%}{module_order filter="all" collection="orders"}{% endcapture-%}
{% if this.orders.items -%}
<table class="data-table order-list collapsing-table" cellpadding="0" cellspacing="0">
    <thead>
        <tr>
            <th>Order</th>
            <th>Date</th>
            <th>Status</th>
            <th>Ammount</th>
        </tr>
    </thead>
    <tbody>
       {{ordersOutput}}                                         
    </tbody>
</table>        
{% else -%}
<div style="text-align: center;font-size: 14px;">You don't have any orders so far. <a href="/shop.html" class="read-more">Go shopping <span>&rarr;</span></a></div>
{% endif %}
javascript:$('.custom-var label').each(function( index ) { console.log("{{ this.['" + $( this ).text() + "'] }}");});
<a href="mailto:{{ this.['Email'] | url_param_escape }}">{{ this.['Email'] | replace: '@', '&#64;' }}</a>
{% assign iOSAppStoreURL = 'https://geo.itunes.apple.com/au/app/hunter-hunter/id946814556?mt=8' -%}
{% assign googlePlayURL  = 'https://play.google.com/store/apps/details?id=au.com.headjam.hunterhunter&hl=en' -%}
{% assign userAgent = globals.visitor.userAgent -%}

{% if userAgent contains 'iPhone' or userAgent contains 'iPad' -%}
    <meta http-equiv="refresh" content="0;URL='{{ iOSAppStoreURL }}'">
{% elsif userAgent contains 'iPod' -%}
    <meta http-equiv="refresh" content="0;URL='{{ iOSAppStoreURL }}'">
{% elsif userAgent contains 'Android' -%}
    <meta http-equiv="refresh" content="0;URL='{{ googlePlayURL }}'">
{% endif -%}
<h3>Archive</h3>
{tag_blogpostarchive,60 template="" collection="blogpostarchive"}
{%comment -%} Suppress the output of the tag_blogpostarchive by using the template="" syntax and capture the data rendered by the tag using the collection="blogpostarchive" syntax {%endcomment -%}

<div class="BlogPostArchive">
    <ul>
        {%comment -%}  Use liquid to loop through the posts archive collected by the tag_blogpostarchive {%endcomment -%}
        {% for item in this.blogpostarchive.items -%}
        <li><a href="{{item.url}}" title="{{item.year}}-{{item.month}}">{{item.month}} {{item.year}} ({{item.count}})</a></li>
        {% endfor -%}
    </ul>
</div>
{%comment -%} suppress the output of the tag_blogrecentpost by using the template="" syntax and capture the data rendered by the tag using the collection="blogrecentposts" syntax  {%endcomment -%}
{tag_blogrecentpost,10 template="" collection="blogrecentposts"}

<div class="BlogRecentPost">
    <ul>
        {%comment -%}  Use liquid to loop through the posts collected by the tag_blogrecentpost  {%endcomment -%}
        {% for post in this.blogrecentposts.items -%}
        <li><a href="{{post.url}}" title="{{post.title}}">{{post.title}}</a></li>
        {% endfor -%}
    </ul>
</div>
{% for item in gv_site.operatingHours %}
  <dt class="OpeningHours-day">{{ item['day'] | capitalize | slice: 0, 3 }}</dt>
  <dd class="OpeningHours-time">

    {% comment %}Convert 24 hour time to 12 hour time{% endcomment %}
    {% assign openTime = item['opens'] | split: ':' -%}
    {% assign closeTime = item['closes'] | split: ':' -%}

    {% if openTime[0] < 13 -%}
        {{ item['opens'] | replace: ':00' }}am
    {% elseif closeTime[0] == 12 -%}
      {{ item['opens'] | replace: ':00' }}pm
    {% else %}
      {{ openTime[0] | minus: 12 }}{{ openTime[1] | prepend: ':' | replace: ':00' }}pm
    {% endif -%}

    &ndash;

    {% if closeTime[0] < 12 -%}
      {{ item['closes'] | replace: ':00' }}am
    {% elseif closeTime[0] == 12 -%}
      {{ item['closes'] | replace: ':00' }}pm
    {% else %}
      {{ closeTime[0] | minus: 12 }}{{ closeTime[1] | prepend: ':' | replace: ':00' }}pm
    {% endif -%}
  </dd>
{% endfor %}
1
2
3
4
5
6
7
{% assign d = globals.site.dateNow | date_add: 1, "day" | date: "%d" %}
{% case d %}
  {% when "1" or "21" or "31" %}{{ d }}st
  {% when "2" or "22" %}{{ d }}nd
  {% when "3" or "23" %}{{ d }}rd
  {% else %}{{ d }}th
{% endcase %}
{% for i in (1..3) -%}
  <div class="col-4@s">
    <div class="ServiceCard">
      {% comment %}We have to prepopulate these vars before using them{% endcomment %}
      {% assign ItemTitle   = "Services " |  append: forloop.index | append: ' - Title' -%}
      {% assign ItemTeaser  = "Services " |  append: forloop.index | append: ' - Description' -%}
      {% assign ItemLink    = "Services " |  append: forloop.index | append: ' - Link' -%}

      <a href="{{ homepage[ItemLink] }}"
         class="ServiceCard-title"
      >{{ homepage[ItemTitle] }}</a>

      <p class="ServiceCard-content">
        {{ homepage[ItemTeaser] }}
      </p>

      {% if homepage[ItemLink] != "" %}
        <a href="{{ homepage[ItemLink] }}"
           class="Button Button--link Button--arrow ServiceCard-link"
        >Read More</a>
      {% endif %}

    </div>
  </div>
{% endfor -%}
{% 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 -%}
<p>Dear {tag_recipientname},</p>
<p>Thank you for contacting us! We will be in touch as soon as we can.</p>

{module_webformresults render="item" collection="formResults" template=""}

{% if formresults.eid contains 'requires you to verify your subscription' %}
<h2>Please confirm your request to join our newsletter.</h2>
<p>If you received this email by mistake, simply delete it.</p>
<p>Your request won't go through if you don't click the confirmation link above.</p>



<table width="100%" border="0" cellspacing="0" cellpadding="0" class="mobile-button-container">
<tbody>
<tr>
<td align="center" style="padding: 5px 0px 20px;" class="padding-copy">
  <table border="0" cellspacing="0" cellpadding="0" class="button-wrapper">
    <tbody>
      <tr>
        <td align="center" class="hj-button-can">{tag_verificationurl}</td>
      </tr>
    </tbody>
  </table>
</td>
</tr>
</tbody>
</table>

{% endif %}

<p>--------------</p>

<h2><strong>Message:</strong></h2>
<pre style="font-size: 13px; font-family: sans-serif;">{{ formresults.results.Message }}</pre>
{% comment %}Break the content apart for the body{% endcomment %}
{% assign content = postItem.['body'] %}

{% assign pargraphArray = content | split: '</p>' %}
{% comment %}Get the first paragraph and replaced the part we split on{% endcomment %}
{% assign featurePargraph = pargraphArray[0] | append: '</p>' %}

{% comment %}Safeguarding against bad markup{% endcomment %}
<div style="font-size:30px; font-weight:bold;">
    {% comment %}We strip the html just as a safeguard{% endcomment %}
    {{ featurePargraph | strip_html | prepend: '<p>' | append: '</p>' }}
</div>
<hr>
{% comment %}Post the body with the first paragraph removed{% endcomment %}
{{ content | replace_first: featurePargraph, '' }}
<hr>
1
2
3
4
5
6
7
8
9
{% assign fruits = "orange apple banana apple orange" | split: ' ' %}
{% assign uniqueFruit = "" %}

{% for fruit in fruits %}
  {% unless uniqueFruit contains fruit %}
    {{ fruit }}
    {% assign uniqueFruit = uniqueFruit | append: ' ' | append: fruit %}
  {% endunless %}
{% endfor %}
<textarea style="width:100%;" cols="30" rows="50"><pre>{{ form | replace: '<td>', '<div class="Control">' | replace: '</td>', '</div>' | replace: '<label', '<label class="Control-label"' | replace: 'cat_textbox', 'ControlInput ControlInput--text' | remove: '<br />' | remove: '<tr>' | remove: '</tr>' | replace: '<select', '<div class="SelectWrap"><select' | replace: '</select>', '</select></div>' }}</pre></textarea>
<div id="test">{{ form }}</div>
<textarea id="replace-form" cols="30" rows="10" style="width: 100%;"></textarea>
<script>
var form = document.getElementById("test");
var replaced = form.innerHTML
                          .replace(/<td><input class="cat_button" type="submit" value="Submit" id="catwebformbutton"><\/td>/g, '<div class="Form-action"><button type="submit" class="Button">Submit<\/button><\/div>')
                          .replace(/<td>/g, '<div class="Control">')
                          .replace(/<label/g, '<label class="Control-label"')
                          .replace(/<\/td>/g, '<\/div>')
                          .replace(/cat_textbox/g, 'ControlInput ControlInput--text')
                          .replace(/<br \/>/g, '')
                          .replace(/<br>/g, '')
                          .replace(/<tr>/g, '')
                          .replace(/<\/tr>/g, '')
                          .replace(/<select/g, '<div class="SelectWrap"><select')
                          .replace(/<\/select>/g, '<\/select><\/div>')
                          .replace(/<table/g, '<fieldset class="Form-inner"')
                          .replace(/<\/table>/g, '<\/fieldset>')
                          .replace(/<span class="req">*<\/span>  Required/, '')
                          .replace(/<tbody>/g, '')
                          .replace(/<\/tbody>/g, '')
;

document.getElementById("replace-form").innerHTML = replaced;

</script>
<script>
{% for myProduct in myProductData.items -%}
  ga('ec:addProduct', {
    'id': {{ myProduct.product.productCode }}',
    'name': {{ myProduct.product.name | remove "'" }}',
    'category' : '',
    'brand' : '',
    'variant' : '{{ myProduct.description | remove "'" }}',
    'price' : '{{ myProduct.unitPrice }}',
    'quantity' : '{{ myProduct.units }}',
  });
  ga('ec:setAction', 'purchase', {
    'id': '{{ myProduct.invoiceNumber }}',
    'affiliation': '',
    'revenue': '{{ myProduct.totalPrice }}',
    'tax': '',
    'shipping': '{{ myProduct.shippingPrice }}',
    'coupon': '{{ myProduct.discountCodeId }}',
  });
{% endfor -%}
</script>
{module_data resource="pages" version="v3" fields="pageUrl,name,title,seoMetadataDescription" resourceId="{module_oid}" skip="0" limit="1" order="id" collection="currentPageCollection"}
{% assign pageDetail = currentPageCollection[0] -%}
{{ this['Summary'] | replace: '<strong>', '[strong]' | replace: '</strong>', '[/strong]' | strip_html | strip | replace: '[strong]', '<strong>' | replace: '[/strong]', '</strong>' }}
<script type="text/javascript" src="/CatalystScripts/Java_DynMenusSelectedCSS.js"></script>
{module_menu menuId="1336130" template="" collection="menu_1336130"}

<div id="cat_1336130_divs">
    <ul id="nav_1336130">
        {% for item in this.menu_1336130.items -%}
        <li><a href="{{item.url}}">{{item.label}}</a></li>
        {% endfor -%}
        {%comment -%} use globals.user variable to verify if user is logged in  {%endcomment -%}
        {% if globals.user.isLoggedIn == 'true' %}
            <li>{module_logout}</li>
        {% endif -%}
    </ul>
</div>
<script type="text/javascript">catSetSelectedCSSItem('nav_1336130');</script>
{% assign metaTitle = -%}
{% assign metaDescription = -%}
{% assign metaTags = -%}
{% assign metaCategory = -%}
{% assign metaTwitterHandle = -%}
{% assign metaURL = -%}
{% assign metaImage = "" -%}
{% assign metaSiteName = "" -%}
{% assign metaCanonicalURL = "" -%}
{% assign metaFacebookAdminID = "" -%}
{% assign metaTwitterCardType = "" -%}

{% case metaTwitterCardType -%}
  {% when 'summary' -%}
    {% assign metaTwitterSize = 'Width=120&amp;Height=120' -%}
  {% when 'summary_large_image' -%}
    {% assign metaTwitterSize = 'Width=500&amp;Height=270' -%}
  {% when 'photo' -%}
    {% assign metaTwitterSize = 'Width=640&amp;Height=478' -%}
  {% when 'product' -%}
    {% assign metaTwitterSize = 'Width=160&amp;Height=160' -%}
{% endcase -%}



{% comment -%} Place this data between the <head> tags of your website {% endcomment -%}
<title>{{ metaTitle }}</title>

<meta name="keywords" content="{{ metaTags }}" >
<meta name="description" content="{{ metaDescription }}" />

{% comment -%} Twitter Card data - Cards can be - summary, summary_large_image, photo  {% endcomment -%}
<meta name="twitter:card" content="photo">
<meta name="twitter:site" content="{{ metaTwitterHandle }}">
<meta name="twitter:title" content="{{ metaTitle }}">
<meta name="twitter:description" content="{{ metaDescription }}">
<meta name="twitter:creator" content="{{ metaTwitterHandle }}">

{% comment -%} Twitter Summary card images must be at least 120x120px {% endcomment -%}
<meta name="twitter:image" content="{{ metaImage }}?Action=thumbnail&amp;algorithm=fill_proportional&amp;{{ metaTwitterSize }}">

{% comment -%} Open Graph data {% endcomment -%}
<meta property="og:title" content="{{ metaTitle }}" />
<meta property="og:type" content="article" />
<meta property="og:url" content="{{ metaURL }}" />
<meta property="og:image" content="{{ metaImage }}}?Action=thumbnail&amp;algorithm=fill_proportional&amp;Width=1200&amp;Height=630" />
<meta property="og:description" content="{{ metaDescription}}" /> 
<meta property="og:site_name" content="{{ metaSiteName }}" />
<meta property="fb:admins" content="{{ metaFacebookAdminID }}" />

{% comment -%} Open Graph Article (Facebook and Pinterest) {% endcomment -%}
<meta property="article:author" content="{{ metaTwitterHandle }}">
<meta property="article:section" content="{{ metaCategory }}">
<meta property="article:tag" content="{{ metaTags }}">

{% Publish Times %}
<meta property="article:published_time" content="{{ this.['releaseDate'] }}">
<meta property="article:modified_time" content="{{ this.['lastupdatedate'] }}">
<meta property="article:expiration_time" content="{{ this.['expiryDate'] }}">



1
2
3
4
5
6
7
<title>{% if this.['Page Title'] != "" -%}{{ this.['Page Title'] }}{% else -%}{{ name }}{% endif -%}</title>

<meta name="description" content="{% if this.['Meta Description'] != "" -%}{{ this.['Meta Description'] }}{% else -%}{{ description | strip_html | replace: "\n", " " | truncate:155 | lstrip | rstrip }}{% endif -%}">

{% if this.['Image Alt Tag'] != "" -%}{% assign imgAlt = this.['Image Alt Tag'] -%}{% else -%}{% assign imgAlt = name -%}{% endif -%}

{{ imgAlt }}
{module_webapps render="collection" id="Venues" filter="all" resultsPerPage="999" collection="venueList" template=""}

{% for venue in venueList.items -%}
  {% if this.['itemid'] == venue.['itemid'] -%}
    {% assign currentIndex = forloop.index0 %}
    {% assign lastIndex = forloop.length | minus: 1 %}
  {% endif -%}
{% endfor -%}

{% if currentIndex == 0 -%}
  {% assign prevItem = lastIndex %}
{% else -%}
  {% assign prevItem = currentIndex | minus: 1 %}
{% endif -%}

{% if currentIndex == lastIndex -%}
  {% assign nextItem = 0 %}
{% else -%}
  {% assign nextItem = currentIndex | plus: 1 %}
{% endif -%}

{module_webapps render="item" id="Venues" filter="item" itemId="{{ venueList.items[prevItem].['itemid'] }}" resultsPerPage="1" template="/Layouts/WebApps/Venues/card.nextItem.tpl"}
{module_webapps render="item" id="Venues" filter="item" itemId="{{ venueList.items[nextItem].['itemid'] }}" resultsPerPage="1" template="/Layouts/WebApps/Venues/card.prevItem.tpl"}
1
2
3
<a href="{{ this.url | split: '/' | first | prepend: '/' }}"
   title="Back to {{ this.url | split: '/' | first }}"
>{% include "/Templates/_includes/icons/chevron-left.svg" -%}</a>
1
2
3
4
<head>
{module_webapps render="collection" id="Customer Care" filter="all" targetFrame="" resultsPerPage="1" sortType="weightreverse" collection="customerCare" template=""}
<meta http-equiv="refresh" content="0; url={{ customerCare.items[0].url }}" />
</head>
{% assign nameLastLetter = globals.user.firstname | slice: -1, 1 %}
{{ globals.user.firstname }}&rsquo;{% unless nameLastLetter == 's' -%}s{% endunless %} Item.
<link rel="stylesheet" href="/theme/dist/css/main.css?v={{ globals.site.dateNow | date: 'yyyy-MM-dd-hh-mm-ss-tt' }}">
{% comment %}
To get a random number we use the computer clock.
We split the last to get the most random time we can get.
Maths - (randomNumber / 1000) * arrayLength
Because we are using the for loop offset the arraylength is actuall minue the desired results
{% endcomment %}

{% comment %}The below is for loops to ensure that the array if offset left the desired results{% endcomment %}
{% assign desiredResults = 2 -%}
{% assign arraySize = randomPrograms.items | size | minus: desiredResults -%}

{% comment %}Random Generator{% endcomment %}
{% assign randomRange = arraySize -%}
{% assign randomGenerator = globals.site.dateNow | date: "fffffff" | convert: "number" | divided_by: 10000000.0000000 | times: randomRange | round -%}

{% for event in randomPrograms.items limit: desiredResults offset: randomGenerator -%}
  {%include "/Layouts/WebApps/Program/liquid.list.tpl" -%}
{% endfor -%}
{% assign randomRange = 100 -%}
{% assign randomGenerator = globals.site.dateNow | date: "fffffff" | convert: "number" | divided_by: 10000000.0000000 | times: randomRange | round -%}
{% assign generateURL = '' -%}
{% assign excludeParamFromURL = 'page, ID' -%}


{% for getParam in globals.get -%}
  {% comment %}if array{% endcomment %}
  {% if excludeParamFromURL contains getParam[0]  %}
    {% continue %}
  {% endif %}
  {% if getParam[1][1] %}
    {% for getValues in getParam[1] %}
      <pre>&amp;{{ getParam[0] }}={{ getValues }}</pre>
      {% assign generateURL = generateURL | append: '&' | append: getParam[0] | append: '=' | append: getValues %}
    {% endfor %}
  {% else %}
    <pre>&amp;{{ getParam[0] }}={{ getParam[1] }}</pre>
    {% assign generateURL = generateURL | append: '&' | append: getParam[0] | append: '=' | append: getParam[1] %}
  {% endif %}
{% endfor -%}

{% comment %}Add the page and domain to the URL {% endcomment %}
{% assign generateURL = generateURL | prepend: globals.get.ID | prepend: gv_site.domain -%}
1
2
3
4
5
{% if globals.visitor.deviceClass == 'phone' -%}
  {% assign imageResizer = '?Action=thumbnail&Width=800&algorithm=fill_proportional' -%}
{% endif -%}

<img src="{{ item.['Feature Image'] | append: imageResizer }}">
{% assign canonicalURL = this['url'] | prepend: gv_site.domain %}
<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "BreadcrumbList",
  "itemListElement": [{
    "@type": "ListItem",
    "position": 1,
    "item": {
      "@id": "{{ gv_site.domain }}/{{ url | split: '/' | first }}",
      "name": "Service Name Here"
    }
  },{
    "@type": "ListItem",
    "position": 2,
    "item": {
      "@id": "{{ canonicalURL }}",
      {% if this['Feature Image'] != "" -%}
        "image": "{{ this['Feature Image'] }}",
      {% endif -%}
      "name": "{{ this['name'] }}"
    }
  }]
}
</script>
<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>
  <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'] }}"
      },
      "geo": {
        "@type": "GeoCoordinates",
        "latitude": {{ gv_site.locations[0].latitude }},
        "longitude": {{ gv_site.locations[0].longitude }}
      },
      "acceptsReservations": "No",
      "url": "{{ gv_site.domain }}",
      "name": "{{ gv_site.name }}",
      "image": "{{ gv_site.domain }}/theme/dist/img/branding/logo.png",
      "description": "{{ currentPageCollection['seoMetadataDescription'] }}",
      "telephone": "{{ gv_site.locations[0]['phone'] | replace: ' ','' | replace: '(', '' | replace: ')', '' }}",
      "priceRange": "$",
      "servesCuisine": [
        {% for menu in menus.items -%}
        "{{ menu['Title'] }}"{% unless forloop.last -%},{% endunless %}
        {% endfor -%}
      ],
      "menu": "{{ gv_site.domain }}/#menu",
      "openingHoursSpecification": [
        {% for item in gv_site.operatingHours -%}
          {
            "@type": "OpeningHoursSpecification",
            "dayOfWeek": "{{ item.day }}",
            "opens": "{{ item.opens }}",
            "closes": "{{ item.closes }}"
          }{% unless forloop.last -%},{% endunless %}
        {% endfor %}
      ],
      "sameAs" : [
      {% for menuSocial in gv_site.social -%}
        "{{ menuSocial[1] }}"{% unless forloop.last -%},{% endunless %}
      {% endfor -%}
      ]
    }
  </script>
<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>
{% comment %}Schema for Team Member{% endcomment %}

<script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Person",
  {% if member['Email Address'] != "" -%}"email": "mailto:{{ member['Email Address'] | url_param_escape }}",{% endif %}
  "image": "{{ member['Staff Photo - Default'] }}",
  "jobTitle": "{{ member['Job Title'] }}",
  "name": "{{ member['First Name'] }} {{ member['Last Name'] }}",
  {% if member['Phone Number'] != "" -%}"telephone": "{{ member['Phone Number'] }}",{% endif %}
  "sameAs" : [
    {% if member['Twitter URL'] != '' -%}"{{ member['Twitter URL'] }}",{% endif %}
    {% if member['Facebook URL'] != '' -%}"{{ member['Facebook URL'] }}",{% endif %}
    {% if member['Google Plus URL'] != '' -%}"{{ member['Google Plus URL'] }}",{% endif %}
    {% if member['LinkedIn URL'] != '' -%}"{{ member['LinkedIn URL'] }}",{% endif %}
    {% if member['Instagram URL'] != '' -%}"{{ member['Instagram URL'] }}",{% endif %}
    ""
  ],
  "url": "{{ activeLocation['url'] | prepend:  gv_site.domain }}#staff-{{ member['itemId'] }}"
}
</script>
{module_searchresults render="collection"
                      collection="searchResults"
                      template=""
}

{% if searchResults.pagination.totalItemsCount == 0 %}
  <p>No results found.</p>
{% endif %}

{% for result in searchResults.items -%}

  {% if result.type == "Pages" %}
    {% comment %}get the page ID and get the REAL URL{% endcomment %}
    {% comment %}expects a url like: "/Default.aspx?PageID=18591060&A=SearchResult&SearchID=2908830&ObjectID=18591060&ObjectType=1" {% endcomment %}
    {% assign searchResultUrlId = result['url'] | split: '&' | first | split: "=" | last  %}
    {module_data resource="pages"
                 version="v3"
                 fields="pageUrl"
                 skip="0"
                 limit="10"
                 where="\{'id':'{{ searchResultUrlId }}'\}"
                 order="id"
                 collection="searchPageLookUp"
    }
    {% comment %}assign it to the page… if there is an error for some reason use the default result{% endcomment %}
    {% assign currentSearchURL = searchPageLookUp.items[0]['pageUrl'] | default: result['url'] | remove: "/index.html" | remove: "/index.htm" %}
  {% else %}
    {% assign currentSearchURL = result['url'] %}
  {% endif %}
  <pre>{{ currentSearchURL }}</pre>
  <a href="{{ currentSearchURL }}"
     class="SearchResult"
  >
    <h3 class="SearchResult-title Text-magenta">
      {{ result['name'] }}
    </h3>
    <div class="SearchResult-description">
      {{ result['description'] }}
    </div>
  </a>
{% endfor %}
{module_productfeaturelist render="collection" tag="Looks we love" sortType="date" collection="looksWeLove" template=""}
<!-- use this on webapp details pages -->
{% assign section = this.url | split: '/' | first %}

{% if globals.visitor.referrer contains gv_site.domain %}
  {% assign backJSClick = 'window.history.back(); false' -%}
  {% assign backURL = 'globals.visitor.referrer' -%}
{% else %}
  {% assign backJSClick = 'true' -%}
  {% assign backURL =  section | prepend: '/' -%}
{% endif %}
<a href="{{ backURL }}"
   title="Back to {{ section }}"
   onclick="{{ backJSClick }}"
>
  Back
</a>
{% assign shareTitle = this.['name'] -%}
{% assign shareURL = this.['url'] | prepend : gv_site.domain -%}
{% assign shareImage = "/theme/dist/img/branding/logo--print.png" | prepend : gv_site.domain -%}
{% assign shareDescription = "Checkout this: " -%}

<div class="SocialShare">
  <div class="SocialShare-icons">
    <a href="https://www.facebook.com/sharer/sharer.php?u={{ shareURL | url_param_escape }}"
       title="Facebook"
       rel="external"
       target="_blank"
       class="SocialShare-icon SocialShare-icon--fb"
    ></a>
    <a href="https://twitter.com/home?status={{ shareDescription | append : shareURL | url_param_escape }}"
       title="Twitter"
       rel="external"
       target="_blank"
       class="SocialShare-icon SocialShare-icon--tw"
    ></a>
    <a href="https://plus.google.com/share?url={{ shareURL | url_param_escape }}"
       title="Google+"
       rel="external"
       target="_blank"
       class="SocialShare-icon SocialShare-icon--go"
    ></a>
    <a href="https://pinterest.com/pin/create/button/?url={{ shareURL | url_param_escape }}&amp;media={{ shareImage | url_param_escape }}&amp;description={{ shareDescription | url_param_escape }}"
       title="Pinterest"
       rel="external"
       target="_blank"
       class="SocialShare-icon SocialShare-icon--pn"
    ></a>
    <a href="https://www.linkedin.com/shareArticle?mini=true&url={{ shareURL | url_param_escape }}&title={{ shareTitle }}&summary={{ shareDescription | url_param_escape }}"
       title="LinkedIn"
       rel="external"
       target="_blank"
       class="SocialShare-icon SocialShare-icon--li"
    ></a>
  </div>
  <div class="SocialShare-count">
    <div class="SocialShare-number js-shareCounter">0</div>
    <div class="SocialShare-title">SHARES</div>
  </div>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5451b05f05f9aff7" type="async"></script>
<script>
  alert('test');
  var shareUrl = "{{ shareURL }}";
  addthis.addEventListener('addthis.ready', function() {
    console.log( addthis.sharecounters );
    addthis.sharecounters.getShareCounts({service: ['facebook','pinterest','linkedin'], countUrl: shareUrl}, function( obj ) {
      console.log(obj);
      var counts = obj.map(function( socialAccount ) { return socialAccount.count; });
      var total = counts.reduce(function(a, b) { return a+b; }, 0);
      console.log( total );
      var i = 0;
      var counter;
      function incrementCounter() {
        i++;
        $('.js-shareCounter').text( i );
        if ( i >= total ) {
          window.clearInterval( counter );
        }
      }
      counter = window.setInterval(incrementCounter, 15);
    });
  });
</script>
<h2>Email List Managment</h2>

<a href="/CampaignProcess.aspx?A=UnsubscribeList&VID={{ globals.user['entityId'] }}&KID=81170"
   class="Button"
>Unsubscribe from members [81170]</a>

<a href="/CampaignProcess.aspx?A=UnsubscribeList&VID={{ globals.user['entityId'] }}&KID=81173"
   class="Button"
>Unsubscribe from primary mailing list [81173]</a>

<a href="/CampaignProcess.aspx?A=UnsubscribeList&VID={{ globals.user['entityId'] }}&KID=81172"
   class="Button"
>Unsubscribe from test [81172]</a>


<a href="/CampaignProcess.aspx?A=Unsubscribe&VID={{ globals.user['entityId'] }}&KID=81170" class="Button Button--red">Unsubscribe All</a>

<hr>


<form action="/CampaignProcess.aspx?A=UnsubscribeList&amp;VID={{ globals.user['entityId'] }}&amp;KID=81172"
      method="post"
>
  <input type="hidden" name="confirm" value="1">
  <button type="submit" class="Button">
    Unsubscribe from Test
  </button>
</form>
1
2
3
4
5
6
7
8
9
{% assign homepageVideoExtension = homepage['Hero Video'] | split: '.' | last | prepend: '.'  -%}
<video class="Video"
       data-object-fit="cover"
       poster="{{ homepage['Hero Video'] | remove: homepageVideoExtension }}.jpg"
       muted autoplay playsinline webkit-playsinline loop
 >
  <source src="{{ homepage['Hero Video'] | remove: homepageVideoExtension }}.mp4" type="video/mp4">
  <source src="{{ homepage['Hero Video'] | remove: homepageVideoExtension }}.webm" type="video/webm">
</video>
<!-- This is a way to get module_data calling the attibutes… it however does not deal with the "stock" of each -->
{module_data resource="productsattributes" version="v3" fields="id,groupName,mandatory,keepStock" where="\{'product.id':'{{ this['id'] }}'\}" skip="0" limit="10" order="id" collection="theproductAttributes"}

<h1>prouct id: {{ this['id'] }}</h1>

<h2>productsattributes</h2>
{% comment %}adding product adds lots of noise but you can get the full product details for the attibutes.{% endcomment %}

{% for productAttribute in theproductAttributes.items %}
  <pre>{{ productAttribute | json }}</pre>

  <h1>{{ productAttribute['groupName'] }}</h1>

  {module_data resource="productsattributeoptions" version="v3" fields="id,siteId,groupId,optionName,imagePath,attribute" skip="0" limit="10" where="\{'groupId':'{{ productAttribute['id'] }}'\}" order="id" collection="productAttributeOptions"}

  {% for singleAttributeOption in productAttributeOptions.items %}
    <pre>{{ singleAttributeOption | json }}</pre>
  {% endfor %}
<hr>
{% endfor %}
1
2
3
4
5
{module_data resource="categories" version="v3" fields="categoryTypeId,category" skip="0" limit="50" where="\{'parentId':'161142','publicAccess':'true'\}" order="id" collection="categories"}

{% for category in categories.items %}
    <a href="{{ category.['categoryTypeId'] }}">{{ category.['category'] }}</a>
{% endfor %}    
{% capture homeAboutText -%}{module_contentholder name="Home - About Summary"}{% endcapture -%}
<p class="Breakout">{{ homeAboutText | strip_html }}</p>
{{this.salePrice | split:'.' | first}}<sup>{{this.salePrice | split:'.' | last}}</sup>
{%comment -%}
    Suppress the output of the module using template="" syntax. Also, capture the data in a collection using collection="shoppingCart" syntax. 
    This way you can customize without JS the layout of the cart summary
{%endcomment -%}

{module_shoppingcartsummary template="" collection="shoppingCart"}
{%comment -%} Use Liquid conditionals for your layout logic {%endcomment -%}

{% if this.shoppingCart.itemCount > 0 -%}
<a href="/OrderRetrievev2.aspx">Shopping Cart ({{this.shoppingCart.itemCount}} items)</a>
{% else -%}
<a href="/OrderRetrievev2.aspx">Shopping Cart (0)</a>
{% endif -%}
1
2
3
4
5
6
7
<select name="CardExpiryYear">
  {% for i in (0..10) -%}
    <option value="{{ globals.site.dateNow | date: "yyyy" | plus: forloop.index0  }}">
      {{ globals.site.dateNow | date: "yyyy" | plus: forloop.index0  }}
    </option>
  {% endfor -%}
</select>
{% capture emailContent %}{tag_pagecontent}{% endcapture %}
{module_webformresults render="item"
                       collection="formResults"
                       template=""
}

{{ emailContent | remove: formResults.eid }}

<strong>Your Form submission:</strong><br>
{% for result in formResults.results %}
  {% unless result[1] == "" or result[0] == "firstName" or result[0] == "lastName" -%}
    <strong>{{ result[0] | replace: "homePhone", "Phone" | replace: "caseId", "Case ID" | capitalize }}:</strong><br>
    {{ result[1] }}<br>
  {% endunless -%}
{% endfor %}
{% if formresults.eid contains 'requires you to verify your subscription' %}
  <p style="font-family:Helvetica,Arial,sans-serif;font-size:18px;font-weight:700;padding:0;margin:30px 0 10px 0;">Confirm your subscription</p>
  <p>Thank you for signing up for our newsletter. Please click the confirmation link to to confirm your subscription.</p>
  <table width="100%" border="0" cellspacing="0" cellpadding="0" class="mobile-button-container">
    <tbody>
      <tr>
        <td align="center" style="padding: 5px 0px 20px;" class="padding-copy">
          <table border="0" cellspacing="0" cellpadding="0" class="button-wrapper">
            <tbody>
              <tr>
                <td align="center" class="hj-button-can">{tag_verificationurl}</td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>
    </tbody>
  </table>
{% endif %}
1
2
3
{% 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
2
3
4
5
6
7
<!-- 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 %}

Comments (0)