The following filters are available in every liquid template.
Always returns false
Returns asset path relative to the current theme’s asset dir on the cdn.
Example: {{ "foo.png" | asset_url }}
results in: “http://cdn2.crystalcommerce.com/themes/clients/TerraBlue/assets/foo.png”.
Returns the url on the cdn for the path specified
Example: {{ "/cats/foo.png" | cdn_url }}
results in: “http://cdn2.crystalcommerce.com/cats/foo.png”.
Given the link text and the url, produces an HTML link. Example: “Foo” | link_to: “foo.com” results in: ”<a href=’foo.com’>Foo</a>”.
Returns the stylesheet tag linking to the given css minification as defined in the themes config
Has optional second argument, if set to true
will just output the css files as separate stylesheet links, use for debugging.
Example: {{ "foo" | css_minify_tag }}
Returns the script tag linking to the given js minification as defined in the themes config
Example: {{ "foo" | js_minify_tag }}
Formats the given amount if it is present and not already formatted. If it isn’t present, returns N/A. The unit defaults to the locale unit (specified by the theme). Examples:
{{ "" | money }}
results in: “N/A”
{{ "$3.50" | money }}
results in: “$3.50”.
{{ 3\.50 | money }}
results in: “$3.50”.
{{ 3\.50 | money: € }}
results in: “€3.50”.
Produces a photo link for the given Category Drop.
Produces a photo link for a generic drop. The drop must have photo and url properties.
Returns a photo url given a Photo Drop. If the photo is null, returns the anchor link “#no-photo-url”. Sizes are thumb, medium, large, huge
Returns an image tag for the given icon name. Options can take the keys size, alt, class, shadow (true/false).
Given a descriptor and a variant, returns the value the variant represents.
Example: variant_drop | descriptor_value: descriptor_drop
results in “English” given a Language variant descriptor.
Given a descriptor name and a variant, returns the value the variant represents,
Example: variant_drop | descriptor_value_by_name: "Language"
results in “English”.
Creates a button which adds a qty of the product with the given text and Product Drop in an AJAXy fashion.
See link_to_add_buy_order.
Creates an AJAX button that takes all the quantities in the catalog form and submits them, adding them to the cart.
Creates an add to cart linki and accompanying text field tag for the qty to add.
Creates a link to add the given product and optional variant to the cart via AJAX.
Increments the given number by the given amount. Seriously.
Creates a button that adds the given product/optional variant to the user’s wishlist via AJAX.
Creates a link to delete an address given an Address Drop.
Creates a link to edit an address given an Address Drop.
Deprecated
Deprecated
Creates a link to delete the given product from the user’s wishlist.
Creates a link to delete the given payment for the user given a Payment Drop.
Creates a link to delete the given coupon for the user given a Coupon Drop.
Generic ajax POST builder. Generates an ajax link which posts to the given url.
Converts newlines to <br /> tags.
Creates option tags for a select tag to choose a country. The selected argument should be the 2-letter country code, like “US”.
Creates an image tag from the given url. Options seem to be ignored. Seriously.
Deprecated.
Deprecated.
Deprecated.
Deprecated.
Deprecated.
Returns a relative path to the icon given the name of it. Example: “check” | icon_url: 16 results in: “/images/icons/16x16/shadow/check.png”
Generates a paginator for the given list of products.
Deprecated
Creates a form for google analytics given an Order Drop.
Generates a survey question input given an Question Drop.
Genrates a url for category browsing given a Category Drop and Pagination Drop.
Dropdown category select form field for limiting a site search by first-level category. Will have selected the current searched for category.
Example:
<select id="search_category_select" name="c"> <option value="1" selected="selected">All Categories</option> <option value="24">Magic Singles</option> </select>
<input id="q" name="q" type="search" placeholder="Search for..." value="whatever" />