Snippets

Team Headjam Creative BC Liquid Snippets

Updated by Headjam Creative

File Ownership grammar apostrophe 's Added

  • Ignore whitespace
  • Hide word diff
+{{ globals.user.firstname }}’{% if globals.user.firstname | slice: -1, 1 == 's' -%}s{% endif %} Item.
Updated by Ben Norman

File Module Detail Page Pagination - Next and Prev Added

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

File Module Pagination - Next and Prev Deleted

  • Ignore whitespace
  • Hide word diff
-{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"}
Updated by Ben Norman

File Module Pagination - Next and Prev Added

  • Ignore whitespace
  • Hide word diff
+{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"}
Updated by Headjam Creative

File eCommerce - Product - Custom Price Styling Added

  • Ignore whitespace
  • Hide word diff
+{{this.salePrice | split:'.' | first}}<sup>{{this.salePrice | split:'.' | last}}</sup>
Updated by Headjam Creative

File Blog Module - Archive Added

  • Ignore whitespace
  • Hide word diff
+<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>

File Blog Module - Recent Posts Added

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