Snippets

Team Headjam Creative BC Liquid Snippets

Updated by James Nowland

File email-notification-remove-hidden.twig Added

  • Ignore whitespace
  • Hide word diff
+{% 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 %}
Updated by James Nowland

File remove images from html tag Deleted

  • 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 %}

File remove images from html tag.html 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 Unsubscribe from Mailing List.html Added

  • Ignore whitespace
  • Hide word diff
+<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>
Updated by James Nowland

File Filter to work around %22uniq%22 filter Added

  • Ignore whitespace
  • Hide word diff
+{% 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 %}
Updated by James Nowland

File Date Suffix Added

  • Ignore whitespace
  • Hide word diff
+{% 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 %}
  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.