News - CrystalCommerce Liquid Documentation for Designers

News

Default Templates

May 25, 2011 Default Templates

We now support default templates. If you don’t have a template, the file is pulled from our default directory. All documentation pages now have what we consider the default liquid template. Only upload template pages that you have changed from the default. This lets the developers add features to all clients without having to update hundreds of templates.


Advanced Search

May 25, 2011 Advanced Search

We’ve added an advanced search (link to it at /advanced_search). See the Advanced Search page for more details. You’ll likely just want to update CSS styling on this. It renders the products using the _product.liquid template, so styling (button changes) added to that will be shown here too.


Search within Category

Apr 24, 2011 Search within Category

Added ability to filter the site search by a first-level category. Use search_category_dropdown and search_query_box.

Example:

<div id="site_search">
  <form id="searchform" method="get" action="{{ site.search_path }}">
    {{ '1' | search_category_dropdown }}
    {{ 'Search for..' | search_query_box }}
    <input value="go" id="searchsubmit" type="submit" />
  </form>
</div>

And add the category selected to the `_search_pagination.liquid` partial.

{% if max > 1 %}
  {% if previous_page %}
    <a href="{{ site.search_path }}?q={{query}}&c={{category_selected}}&page={{previous_page}}">Previous</a> |
  {% endif %}
  Page {{ current_page }} of {{ max }}
  {% if next_page %}
    | <a href="{{ site.search_path }}?q={{query}}&c={{category_selected}}&page={{next_page}}">Next</a>
  {% endif %}
{% endif %}

Reorder HTML Title tag

Apr 7, 2011 Reorder HTML Title tag

SiteDrop#extra_title has been upgraded to place the product name before the category heirarchy for SEO purposes.

Example: before you’d see:

Magic Singles » Core Sets » 10th Edition » Academy Researchers

but now you should see:

Academy Researchers - Magic Singles » Core Sets » 10th Edition

Buylist URL

Apr 4, 2011 Buylist URL

Add product.buylist_url to link to the buylist page for a product. Buylist product page support forth-coming.

In _product.liquid

Replace:

<a href="{{ product.url }}">{{ product.name }}</a>

With:

<a href="{% if site.buylist_mode? %}{{ product.buylist_url }}{% else %}{{ product.url }}{% endif %}">{{ product.name }}</a>

Escape query variable

Mar 25, 2011 Escape query variable

The query variable on /products/search is now HTML escaped. This prevents a cross-site scripting attack.


Preorder attributes

Mar 16, 2011 Preorder attributes

Added ProductDrop#preorder? and ProductDrop#available_on to expose Preorder information.

Usage

In _product.liquid:

@@ -1,1 +1,1 @@
-<tr id="{{ product.row_id }}" class="{% cycle 'even', 'odd' %}">
+<tr id="{{ product.row_id }}" class="{% cycle 'even', 'odd' %}{% if product.preorder?"}} %} preorder{% endif %}">

@@ -16,16 +16,21 @@
-<a href="{{ product.url }}">{{ product.name }}</a><br />
+<a href="{{ product.url }}">{{ product.name }}</a>
+{% if product.preorder? %}
+  <span class="preorder_date">Preorder now! Available on
+    {{ product.available_on }}</span>
+{% endif %}
+<br />

@@ -37,37 +42,48 @@
-<td align="right" width="30%">{{ 'Buy" | link_to_add_cart_with_qty: product, variant' }} }}</td>
+<td align="right" width="30%">
+  {% if product.preorder? %}
+    {{ 'Preorder Now" | link_to_add_cart_with_qty: product, variant' }} }}
+  {% else %}
+    {{ 'Buy" | link_to_add_cart_with_qty: product, variant' }} }}
+  {% endif %}
+</td>

In product.liquid:

@@ +17,20 @@
+{% if product.preorder? %}
+<h2>Preorder now!</h2>
+<p>Available on {{ product.available_on }}</p>
+{% endif %}

@@ -56,56 +60,64 @@
-{{ '<span class='}}'add_to_cart button'{{ '>Add to Cart</span>" | link_to_add_cart: product, variant ' }}}}
+{% if product.preorder? %}
+  {{ '<span class='}}'add_to_cart button'{{ '>Preorder Now!</span>" | link_to_add_cart: product, variant ' }}}}
+{% else %}
+  {{ '<span class='}}'add_to_cart button'{{ '>Add to Cart</span>" | link_to_add_cart: product, variant ' }}}}
+{% endif %}