Jonathan Rudenberg 07/13/2011

New Liquid Template Features

I just pushed three new features for your liquid templating pleasure:

Raw tag

Web developers are using client-site templates like Mustache and jQuery Templates more and more these days, but they use the same curly braces as liquid, so it's hard to mix them into liquid templates. There is now a solution to this:

{% raw %}
  <h1>{{ title }}</h1>
{% endraw %}

The raw tag will render its contents verbatim, so this is the result:

<h1>{{ title }}</h1>

Read all about it on the wiki. is a new boolean that allows you to easily tell if the current page is the same as a link in a linklist.

{% for link in linklists.main-menu.links %}
   <a href="{{ link.url }}"{% if %} class="active"{% endif %}>{{ link.title }}</a>
{% endfor %}

There are some nuances to it, so make sure you read the documentation on the wiki.

Alternate views

Did you know that you can make multiple versions of a template? Previously they were only selectable on a per-product basis. But now you can pick an alternate template using the url. For example, visiting will use product.quick.liquid. (Take a look at it in action on the collection page)

This works for all templates: appending ?view=foo to the URL will use You can create alternate templates by clicking 'add new template' in the Template Editor.