Add Liquid samples.

This commit is contained in:
Parker Moore
2014-04-23 17:45:16 -04:00
parent cb844a1913
commit ccce5475bf
2 changed files with 174 additions and 0 deletions

View File

@@ -0,0 +1,104 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>{{shop.name}} - {{page_title}}</title>
{{ 'textile.css' | global_asset_url | stylesheet_tag }}
{{ 'lightbox/v204/lightbox.css' | global_asset_url | stylesheet_tag }}
{{ 'prototype/1.6/prototype.js' | global_asset_url | script_tag }}
{{ 'scriptaculous/1.8.2/scriptaculous.js' | global_asset_url | script_tag }}
{{ 'lightbox/v204/lightbox.js' | global_asset_url | script_tag }}
{{ 'option_selection.js' | shopify_asset_url | script_tag }}
{{ 'layout.css' | asset_url | stylesheet_tag }}
{{ 'shop.js' | asset_url | script_tag }}
{{ content_for_header }}
</head>
<body id="page-{{template}}">
<p class="hide"><a href="#rightsiders">Skip to navigation.</a></p>
<!-- mini cart -->
{% if cart.item_count > 0 %}
<div id="minicart" style="display:none;"><div id="minicart-inner">
<div id="minicart-items">
<h2>There {{ cart.item_count | pluralize: 'is', 'are' }} {{ cart.item_count }} {{ cart.item_count | pluralize: 'item', 'items' }} in <a href="/cart" title="View your cart">your cart</a>!</h2><h4 style="font-size: 16px; margin: 0 0 10px 0; padding: 0;">Your subtotal is {{ cart.total_price | money }}.</h4>
{% for item in cart.items %}
<div class="thumb">
<div class="prodimage"><a href="{{item.product.url}}" onMouseover="tooltip('{{ item.quantity }} x {{ item.title }} ({{ item.variant.title }})', 200)"; onMouseout="hidetooltip()"><img src="{{ item.product.featured_image | product_img_url: 'thumb' }}" /></a></div>
</div>
{% endfor %}
</div>
<br style="clear:both;" />
</div></div>
{% endif %}
<div id="container">
<div id="header">
<!-- Begin Header -->
<h1 id="logo"><a href="/" title="Go Home">{{shop.name}}</a></h1>
<div id="cartlinks">
{% if cart.item_count > 0 %}
<h2 id="cartcount"><a href="/cart" onMouseover="tooltip('There {{ cart.item_count | pluralize: 'is', 'are' }} {{ cart.item_count }} {{ cart.item_count | pluralize: 'item', 'items' }} in your cart!', 200)"; onMouseout="hidetooltip()">{{ cart.item_count }} {{ cart.item_count | pluralize: 'thing', 'things' }}!</a></h2>
<a href="/cart" id="minicartswitch" onclick="superSwitch(this, 'minicart', 'Close Mini Cart'); return false;" id="cartswitch">View Mini Cart ({{ cart.total_price | money }})</a>
{% endif %}
</div>
<!-- End Header -->
</div>
<hr />
<div id="main">
<div id="content">
<div id="innercontent">
{{ content_for_layout }}
</div>
</div>
<hr />
<div id="rightsiders">
<ul class="rightlinks">
{% for link in linklists.main-menu.links %}
<li>{{ link.title | link_to: link.url }}</li>
{% endfor %}
</ul>
{% if tags %}
<ul class="rightlinks">
{% for tag in collection.tags %}
<li><span class="add-link">{{ '+' | link_to_add_tag: tag }}</span>{{ tag | highlight_active_tag | link_to_tag: tag }}</li>
{% endfor %}
</ul>
{% endif %}
<ul class="rightlinks">
{% for link in linklists.footer.links %}
<li>{{ link.title | link_to: link.url }}</li>
{% endfor %}
</ul>
</div>
<hr /><br style="clear:both;" />
<div id="footer">
<div class="footerinner">
All prices are in {{ shop.currency }}.
Powered by <a href="http://www.shopify.com" title="Shopify, Hosted E-Commerce">Shopify</a>.
</div>
</div>
</div>
</div>
<div id="tooltip"></div>
<img id="pointer" src="{{ 'arrow2.gif' | asset_url }}" />
</body>
</html>

View File

@@ -0,0 +1,70 @@
<h3>We have wonderful products!</h3>
<ul id="products">
<div id="productpage">
<div id="productimages"><div id="productimages-top"><div id="productimages-bottom">
{% for image in product.images %}
{% if forloop.first %}
<a href="{{ image | product_img_url: 'large' }}" class="productimage" rel="lightbox">
<img src="{{ image | product_img_url: 'medium'}}" alt="{{product.title | escape }}" />
</a>
{% else %}
<a href="{{ image | product_img_url: 'large' }}" class="productimage-small" rel="lightbox">
<img src="{{ image | product_img_url: 'small'}}" alt="{{product.title | escape }}" />
</a>
{% endif %}
{% endfor %}
</div></div></div>
<h2>{{ product.title }}</h2>
<ul id="details" class="hlist">
<li>Vendor: {{ product.vendor | link_to_vendor }}</li>
<li>Type: {{ product.type | link_to_type }}</li>
</ul>
<small>{{ product.price_min | money }}{% if product.price_varies %} - {{ product.price_max | money }}{% endif %}</small>
<div id="variant-add">
<form action="/cart/add" method="post">
<select id="variant-select" name="id" class="product-info-options">
{% for variant in product.variants %}
<option value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money }}</option>
{% endfor %}
</select>
<div id="price-field" class="price"></div>
<div style="text-align:center;"><input type="image" name="add" value="Add to Cart" id="add" src="{{ 'addtocart.gif' | asset_url }}" /></div>
</form>
</div>
<div class="description textile">
{{ product.description }}
</div>
</div>
<script type="text/javascript">
<!--
// prototype callback for multi variants dropdown selector
var selectCallback = function(variant, selector) {
if (variant && variant.available == true) {
// selected a valid variant
$('add').removeClassName('disabled'); // remove unavailable class from add-to-cart button
$('add').disabled = false; // reenable add-to-cart button
$('price-field').innerHTML = Shopify.formatMoney(variant.price, "{{shop.money_with_currency_format}}"); // update price field
} else {
// variant doesn't exist
$('add').addClassName('disabled'); // set add-to-cart button to unavailable class
$('add').disabled = true; // disable add-to-cart button
$('price-field').innerHTML = (variant) ? "Sold Out" : "Unavailable"; // update price-field message
}
};
// initialize multi selector for product
Event.observe(document, 'dom:loaded', function() {
new Shopify.OptionSelectors("variant-select", { product: {{ product | json }}, onVariantSelected: selectCallback });
});
-->
</script>
</ul>