Created
October 6, 2012 00:12
-
-
Save rdallaire/3843183 to your computer and use it in GitHub Desktop.
Common liquid snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These snippets are to included right before the </body> tag: | |
- Mouse-Chaser Reference –– | |
{{ site.mouse_chaser }} | |
- High-Slide Reference –– | |
<div id="highslide-container"></div> | |
<div id="controlbar" class="highslide-overlay controlbar"> | |
<a href="javascript:void(0)" onclick="return hs.previous(this)" title="Previous (left arrow key)"></a> | |
<a href="javascript:void(0)" onclick="return hs.next(this)" title="Next (right arrow key)"></a> | |
<a href="javascript:void(0)" class="highslide-move" title="Click and drag to move" style="margin-left: 10px"></a> | |
<a href="javascript:void(0)" onclick="hs.close(this)" title="Click to close"></a> | |
</div> | |
<!-- Banner automation --> | |
{ if current_date.month > 7 or current_date.month == 7 and current_date.day >= 13 } ORDER NOW BANNER HERE | |
{ else } PRE ORDER BANNER HERE | |
{ endif } | |
If you absolutely needed to include year, you’d have some redundancies: | |
{ if current_date.year 2012 %} {% if current_date.month > 7 or current_date.month 7 and current_date.day >= 13 } ORDER NOW BANNER HERE { else } PRE-ORDER BANNER HERE { endif } | |
{ elsif current_date.year > 2012 } ORDER NOW BANNER HERE | |
{ else } PRE-ORDER BANNER HERE | |
{ endif } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if site.buylist_mode? %} | |
<div id="selling"> | |
<p><span>You are currently browsing to sell us cards.</span><br /> | |
Click <a href="/buylists/stop_selling">here</a> to return to buying cards from us.<br /> | |
</div> | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% include 'category_tree' %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copyright Date | |
{{ 'now' | date: "%Y" }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if current_customer.logged_in? %} | |
<ul> | |
<li>{{ current_customer.fullname }}</li> | |
<li><a href="/user/wishlist">Wishlist</a></li> | |
<li><a href="">Refer A Friend</a></li> | |
<li><a href="/user/orders">Orders</a></li> | |
<li><a href="/user/change_password">Account</a></li> | |
<li><a href="/user/home">Change Password</a></li> | |
<li><a href="/user/logout">Log Out</a></li> | |
</ul> | |
{% else %} | |
<ul> | |
<li><a href="/user/signup">Register</a></li> | |
<li><a href="/user/login">Login</a></li> | |
</ul> | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Show something based on category name --> | |
{% if product.category.name == "Category Name" %} | |
FOR ALL PRODUCTS IN THE CATEGORY CALLED "CATEGORY NAME" DISPLAY THIS INFORMATION | |
{% else %} | |
FOR ALL OTHER PRODUCTS DISPLAY THIS INFORMATION | |
{% endif %} | |
<!-- We went with this approach because calling out by category.name, we have | |
a more reliable way of defining the statement. This can be applied for different | |
products with the use of {% elsif %} statement. | |
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- for specific pages based on the page name --> | |
{% if site.pagename == "home" or site.pagename == "welcome" %} | |
<!-- place content and things you want here on the home or welcome pages --> | |
{% else %} | |
{{ content_for_layout }} | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="quick_cart"> | |
{% include "quick_cart" with order %} | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script language="javascript" type="text/javascript"> | |
jQuery(document).ready(function() { | |
setupCategoryTree(); | |
showCategory({{ current_category.id }}); | |
markCurrentItem({{ current_category.id }}); | |
//showCategory(123); | |
facebox = new Facebox(); | |
}); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<title>ClientName - {{ site.extra_title }}</title> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{ if current_date.month > 7 or current_date.month == 7 and current_date.day >= 13 } ORDER NOW BANNER HERE
{ else } PRE ORDER BANNER HERE
{ endif }
If you absolutely needed to include year, you’d have some redundancies:
{ if current_date.year 2012 %} {% if current_date.month > 7 or current_date.month 7 and current_date.day >= 13 } ORDER NOW BANNER HERE { else } PRE-ORDER BANNER HERE { endif }
{ elsif current_date.year > 2012 } ORDER NOW BANNER HERE
{ else } PRE-ORDER BANNER HERE
{ endif }